Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Iask 1 : Arrays and Structure ( 2 0 pt ) In this task, we will create a structure called myArray and it will have

Iask 1: Arrays and Structure (20pt)
In this task, we will create a structure called myArray and it will have the following members:
A[1000] : an array that stores up to 1000 integer numbers. A is the 1D representation of a 3D array
shape[3]: an array that contains the dimensions of the 3D array.
Subtasks:
Create a structure myArray. Must finish in Lab. (2pt)
Create a function called random that creates a structure myArray. Must finish in Lab. (3pt)
Create a function called sum that returns the sum of the matrices. Must finish in Lab.(3pt)
Create a function called print to print the 3D array. Must finish in Lab. (2pt)
Create a function called multiply that returns the element-wise matrix multiplication between two matrices. Must finish in Lab. (3pt)
Create a function called matmul that return the matrix multiplication between two matrices. This operation is only perform to the last two dimensions of the array(5pt)
Create one or more functions to check if the operation can be performed. Do not consider broadcasting. (2pt)
For all the function except random and the ones used to check, the only type of argument allowed is myArray. Note: Pointers are not allowed. Built-in functions are not allowed.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions