logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

C/C++ Comment Standards File header each file in the solution shall have a comment block which identifies.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

C/C++ Comment Standards

 

I. File Header

Each file in the solution shall have a comment block which identifies:

 

  1. The file name,

  2. The author of the file,

  3. Modification History

a Who modified the file b When

  1. The classes/procedures in the file with a one line description

 

 

 

/***************************************************************************

  • File: c

  • Author: Richard Goodrum

  • Procedures:

  • main - test program which initializes the data elements, time matmul, and prints results

  • matmul - brute force matrix multiplication

***************************************************************************/

 

 

II.  Class/Procedure Header

Each class/procedure shall have a comment block preceding it which contains:

 

  1. The class/procedure name,

  2. The author of the class/procedure,

  3. Modification History

    1. Who modified the class/procedure

    2. When

  4. A summary description of the class/procedure, 4. A list of all arguments with:

    1. Argument name,

    2. Direction: Input (I/P), Output (O/P), Input/Output (I/.O),

    3. Type (I.e., char, double, float, int, long, ),

    4. One line description of the

 

/***************************************************************************

  • int main( int argc, char *argv[] )

  • Author: Dr. Richard A. Goodrum, D.

  • Date: 16 September 2017

  • Description: Generates two matrices and then calls matmul to multiply

  • Finally, it verifies that the results are

*

  • Parameters:

*         argc

I/P

int

The number of arguments on the command line

*         argv

I/P

char *[]

The arguments on the command line

*         main

O/P

int

Status code (not currently used)

**************************************************************************/

 

/***************************************************************************

  • int matmul( int l, int m, int n, float *A, float *B, float *C )

  • Author: Dr. Richard A. Goodrum, D.

  • Date: 16 September 2017

  • Description: brute force matrix multiplication function.

*

  • Parameters:

*         l

I/P

int

The first dimension of A and C

*         m

I/P

int

The second dimension of A and first of B

*         n

I/P

int

The second dimension of B and C

*         A

I/P

float *

The first input matrix

*         B

I/P

float *

The second input matrix

*         C

O/P

float *

The output matrix

*         matmul

O/P

int

Status code (not currently used)

***************************************************************************/

 

 

III. Inline Comments

Many lines of the file should include comments to describe the concept represented by the line. For example:

y = m * x + b; // Calculate the value of y based on a linear equation and

// the value of x

 

IV. Other Comments

Occasionally, a block of code needs a preamble to explain its nature. Hence, a block comment should precede it.

 

int matmul( int l, int m, int n, float *A, float *B, float *C )

{

int i, j, k;

 

for( i=0; i<l; i++ )                                            // Loop over the rows of A and C.

for( k=0; k<n; k++ )                                      // Loop over the columns of B and C

{

// Initialize the output element for the inner

// product of row i of A with column j of B C[i*n+k] = 0;

for( j=0; j<m; j++ )                                      // Loop over the columns of A and C

{

C[i*n+k] += A[i*m+j] * B[j*n+k];     // Compute the inner product

}

}

}

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

886 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

991 Answers

Hire Me
expert
Husnain SaeedComputer science

595 Answers

Hire Me
expert
Atharva PatilComputer science

936 Answers

Hire Me