C Workshop
Transpose.h File Reference
#include <stdio.h>

Go to the source code of this file.

Macros

#define CELL_WIDTH   3
 
#define CELL_PRECISION   0
 

Typedefs

typedef double matrix_element
 Type definition for a numeric matrix element. More...
 

Enumerations

enum  matrix_type { NONE , SYMMETRIC , SKEW_SYMMETRIC }
 enum for matrix types More...
 

Functions

enum matrix_type TransposeMatrix (matrix_element **matrix, size_t size)
 Recieves a square matrix and transposes it in place. More...
 
void SwapElements (matrix_element *first, matrix_element *second)
 Swaps two matrix elements. More...
 
void PrintMatrix (matrix_element **matrix, size_t size)
 Prints a square matrix. More...
 

Macro Definition Documentation

◆ CELL_PRECISION

#define CELL_PRECISION   0

◆ CELL_WIDTH

#define CELL_WIDTH   3

Typedef Documentation

◆ matrix_element

typedef double matrix_element

Type definition for a numeric matrix element.

Enumeration Type Documentation

◆ matrix_type

enum for matrix types

Enumerator
NONE 
SYMMETRIC 
SKEW_SYMMETRIC 

Function Documentation

◆ PrintMatrix()

void PrintMatrix ( matrix_element **  matrix,
size_t  size 
)

Prints a square matrix.

Parameters
matrixMatrix to print
sizeSize of the matrix (rows and columns)

◆ SwapElements()

void SwapElements ( matrix_element first,
matrix_element second 
)

Swaps two matrix elements.

Parameters
firstThe first element
secondThe element to swap with

◆ TransposeMatrix()

enum matrix_type TransposeMatrix ( matrix_element **  matrix,
size_t  size 
)

Recieves a square matrix and transposes it in place.

Parameters
matrixThe matrix to transpose
sizeThe size of the matrix (rows and columns)
Returns
corresponding value from the enum matrix_type describing whether it is symmetric, skew-symmetric, or neither
Parameters
matrixThe matrix to transpose
sizeThe size of the matrix (rows and columns)