muMECH
1.0
|
Collection of the functions of basic manipulations, some of them can be used instead of their counterparts defined as macros in 'macros.h'. More...
#include <time.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Namespaces | |
mumech | |
Macros | |
#define | _MATHEMATICA_SYNTAX_ 0 |
#define | _STANDARD_SYNTAX_ 1 |
Enumerations | |
enum | mumech::file_mode { mumech::_READ_, mumech::_WRITE_, mumech::_ADD_ } |
Functions | |
*** VARIOUS FUNCTIONS *** | |
Operations with arrays of chars | |
void | mumech::PrintProgress (double procento, int incr) |
Operations with arrays of chars. More... | |
void | mumech::PrintProgress (clock_t *p_time) |
double | mumech::giveVolumeEllipsoid (double a, double b, double c) |
Function gives the volume of an allipsoid defined by its semiaxes a, b, c. More... | |
double | mumech::give_curvature (double x, double a, double b) |
double | mumech::acosh (double x) |
Inverse hyperbolic cosine. More... | |
*** FILE PROCESSING *** | |
Operations with file descriptors | |
void | mumech::OpenFile (FILE **file, char *name, const char mode[]) |
Operations with file descriptors. More... | |
void | mumech::OpenFile (FILE *&file, char name[], int mode) |
description: functions opens a file and tests the succes of the opening note: function requires the global (outer) definition of @*file More... | |
void | mumech::CloseFile (FILE *file) |
description: function closes a previously opened file and tests the succes of the closing note: function requires the global (outer) definition of @*file More... | |
void | mumech::GoToEndOfLine (FILE *fr) |
description: functions moves the cursor the the end of line (EOLN) in a text file last edit: 1.10.2006 More... | |
void | mumech::LatexPreambule (FILE *fw) |
description: function prints a simple preamble of a LaTEX document last edit: 16.05.2007 More... | |
void | mumech::LatexEnd (FILE *fw) |
description: function prints the end (closing part) of LaTEX document last edit: 16.05.2007 More... | |
*** STRING PROCESSING *** | |
Funkce zapise LENGTH bytu z BUFFER do docasneho souboru. Pote je jmeno souboru zruseno v filesystemu(unlink). Vraci deskriptor souboru. Operations with arrays of chars | |
int | mumech::GetRangeOfFileRows (char *p_name) |
Funkce zapise LENGTH bytu z BUFFER do docasneho souboru. More... | |
int | mumech::GetRangeOfFileColumns (char *p_name) |
Function gives the number columns of the file such as is not necessarilly. More... | |
int | mumech::GetRangeOfFileColumns_ii (char *p_name) |
Function gives the number columns of a file structured as a table. More... | |
*** GENERAL VECTOR OPERATIONS *** | |
Operations with 1d arrays of various length | |
bool * | mumech::Allocate1Dbz (long d1) |
Function allocates ('new' command) a 1d array of bool set to zero. More... | |
bool ** | mumech::Allocate1Dbp (long d1) |
Function allocates ('new' command) a 1d array of bool* pointers set to NULL. More... | |
int * | mumech::Allocate1Di (long d1) |
Function allocates ('new' command) a 1d array of int. More... | |
double * | mumech::Allocate1Dd (long d1) |
Function allocates ('new' command) a 1d array of double. More... | |
double * | mumech::Allocate1Ddz (long d1) |
Function allocates ('new' command) a 1d array of double set to zero. More... | |
double ** | mumech::Allocate1Ddp (long d1) |
Function allocates ('new' command) a 1d array of double* pointers set to NULL. More... | |
double *** | mumech::Allocate1Ddpp (long d1) |
Function allocates ('new' command) a 1d array of double** pointers set to NULL. More... | |
void | mumech::CleanVector (double *a, long n) |
Functin cleans a 'double' vector, initialize each value being 0-zero. More... | |
void | mumech::CleanVector (int *a, long n) |
Functin cleans a 'int' vector, initialize each value being 0-zero. More... | |
void | mumech::CleanVector (long *a, long n) |
Functin cleans a 'long' vector, initialize each value being 0-zero. More... | |
double | mumech::GiveSumMembersVector (const double *a, long n) |
Function returns sum of all member of 'array'. More... | |
void | mumech::CopyVector (const double *src, double *dest, long n) |
Function copy given number of components from vector, 'a' to vector 'b'. More... | |
void | mumech::CopyVector (const long *src, long *dest, long n) |
Function copy given number of components from vector, 'a' to vector 'b'. More... | |
void | mumech::CopyVector (const int *src, int *dest, long n) |
Function copy given number of components from vector, 'a' to vector 'b'. More... | |
void | mumech::AddVector (const double *a, double *b, long n) |
Function add given number of components from vector 'a' to vector 'b', b += a. More... | |
void | mumech::AddVector (const int *a, int *b, long n) |
Function add given number of components from vector 'a' to vector 'b', b += a. More... | |
void | mumech::SubtractVector (const double *a, double *b, long n) |
Function subtracts given number of components vector 'a' from vector 'b'; b -= a. More... | |
void | mumech::SubtractTwoVectors (const double *v1, const double *v2, double *answer, long n) |
Function subtracts two vectors of entries. answer = v1 - v2. More... | |
void | mumech::AddScalarToVector (long s, long *v, long n) |
Function add given number of components from vector 'a' to vector 'b'. More... | |
void | mumech::SumTwoVectors (const double *v1, const double *v2, double *answer, long n) |
Function sums two vectors of entries. resVec = vec1 - vec2. More... | |
void | mumech::AddVectorMultipledBy (double mlt, const double *a, double *b, long n) |
Function add given number of components multiplied by 'mlt' from vector 'a' to vector 'b'. More... | |
void | mumech::DivideVector (double *a, long n, double val) |
Function divides 'n' components of field 'a' by value 'val'. More... | |
void | mumech::MultiplyVector (double *a, long n, double val) |
Function multiplies 'n' components of field 'a' by value 'val'. More... | |
double | mumech::give_VectorVectorProduct (const double *v1, const double *v2, long n) |
Operations with 1d arrays of various length. More... | |
double | mumech::give_quadNormTwoVectors (const double *v1, const double *v2, int n) |
Function returns the quadratic norm of two vectors of length 'n'. More... | |
void | mumech::ReadDataToArray (double **p_array, char *p_file_name) |
description: function initializes a 2D 'double' array from a given file More... | |
void | mumech::ReadDataTo3DArray (double ***p_array, char *p_file_name, int no_fields, int no_rows, int no_columns) |
description: function initializes a 3D 'double' array by values from a given file More... | |
void | mumech::ReadDataToArray (int **p_array, char *p_file_name) |
description: function initializes a 3D 'int' array by values from a given file More... | |
void | mumech::ReadDataToVector (int *p_array, char *p_file_name) |
description: function initializes an 'int' vector by values from a given file More... | |
double | mumech::giveVectorLength (double *point_1, double *point_2) |
Function returns the length of a vector given by 3D coordinates of two points. More... | |
double | mumech::giveVectorLength (double rx, double ry, double rz) |
Function returns the length of a vector given by its components. More... | |
bool | mumech::isNumberPresentInVector (int number, int *vect, int range) |
description: function returns TRUE/FALSE if a occurs/doesn't occurs in a , respectively More... | |
*** GENERAL ARRAY OPERATIONS *** | |
Operations with 2d, 3d, 4d arrays of various sizes | |
double ** | mumech::AllocateArray2D (long d1, long d2) |
Operations with 2d, 3d, 4d arrays of various sizes. More... | |
void | mumech::AllocateArray2D (double **&array, long d1, long d2) |
Function allocates a 2D 'double' array by 'new' command. More... | |
void | mumech::DeleteArray2D (bool **array, long d1) |
Function deletes a 2D 'bool' array of dimension d1 x ??, allocated by new. More... | |
void | mumech::DeleteArray2D (double **array, long d1) |
Function deletes a 2D 'double' array of dimension d1 x ??, allocated by new. More... | |
void | mumech::DeleteArray3D (double ***array, long d1, long d2) |
Function deletes a 3D 'double' array of dimension d1 x d2 x ??, allocated by new. More... | |
void | mumech::CleanArray2D (int **a, long rows, long columns) |
Function cleans an 2d 'int' array, initialize each value being 0-zero. More... | |
void | mumech::CleanArray2d (double **a, long rows, long columns) |
Function cleans an 2d 'double' array, initialize each value being 0-zero. More... | |
void | mumech::CopyArray2D (const double *const *src, double **dest, long d1, long d2) |
Function copy two 2D double arrays with dimensions d1xd2 from 'src' to 'dest'. More... | |
void | mumech::CopyArray3D (const double ***src, double ***dest, long d1, long d2, long d3) |
Function copy two 3D double arrays with dimensions d1xd2xd3 from 'src' to 'dest'. More... | |
void | mumech::AddArray2D (const double *const *src, double **dest, long d1, long d2) |
Function add 2D double array with dimensions d1xd2 from 'src' to 'dest'. More... | |
void | mumech::AddArray3D (double ***src, double ***dest, long d1, long d2, long d3) |
Function add 3D double array with dimensions d1xd2xd3 from 'src' to 'dest'. More... | |
void | mumech::DivideArray2D (double **a, double val, long d1, long d2) |
Function divides 2D double array 'a' with dimensions d1xd2 by value 'val'. More... | |
void | mumech::SubtractTwoArrays2D (const double *const *a1, const double *const *a2, double **answer, long d1, long d2) |
Function subtracts two 2D double arrays with dimensions d1xd2. answer = v1 - v2. More... | |
void | mumech::giveInverseMatrix2x2 (double *answer, const double *m) |
Function computes inverse of the row-wise saved 2x2 matrix 'm'. More... | |
void | mumech::giveInverseMatrix3x3 (double *answer, const double *m) |
Function computes inverse of the row-wise saved 3x3 matrix 'm'. More... | |
void | mumech::giveInverseMatrix3x3to5 (double *answer, const double *m) |
Function computes inverse of the eshelby-like 3x3 matrix 'm' saved in reduced 3x3to5 form. More... | |
void | mumech::giveInverseMatrix6x6to12 (double *answer, const double *m) |
Function computes inverse of the eshelby-like 3x3 matrix 'm' saved in reduced 6x6to12 form. More... | |
double | mumech::GiveSumMembersArray2D (const double **a, long d1, long d2) |
Function returns sum of all member of array 'a'. More... | |
void | mumech::copyMatrix_1Dto2D (const double *v, double **m, long n) |
Function copies 2D matrix saved in row-wise vector v[n * n] to 2d array m[n][n]. More... | |
void | mumech::copyMatrix_2Dto1D (const double *const *m, double *v, long n) |
Function copies 2D matrix saved in 2d array m[n][n] to row-wise vector v[n * n]. More... | |
void | mumech::giveUnitMatrix2x2 (double *m) |
Function sets 3x3 matrix to unit matrix. More... | |
void | mumech::giveUnitMatrix3x3 (double *m) |
Function sets 3X3 matrix to unit matrix. More... | |
void | mumech::giveMatrixVectorProduct (const double *mtrx, const double *vect, double *resVect, long n) |
Function gives the product of a regular matrix with a vector. More... | |
void | mumech::giveMatrixMatrixProduct (const double *mtrx1, const double *mtrx2, double *resMtrx, long n) |
Function gives the product of two regular matrices. More... | |
void | mumech::giveTransposedMatrix (const double *mtrx, double *T_mtrx, int n) |
Function gives the trasposition of a matrix saved in row-by-row C arrangement. More... | |
void | mumech::printMatrix (double *mtrx, int n, const char *notice) |
Function prints a matrix which are saved in 'row-by-row' C arrangement as 1D arrays. More... | |
void | mumech::printMatrix (double **mtrx, int n, const char *notice) |
Function prints a matrix which is saved as 2D array. More... | |
void | mumech::printVector (double *vect, int n, const char *notice) |
Function prints the vector of double values as column. More... | |
void | mumech::printVector (int *vect, int n, const char *notice) |
Function prints the vector of integers as column. More... | |
void | mumech::printVectorRowForm (double *vect, int n, const char *notice) |
Function prints the vector of double values as row. More... | |
void | mumech::printVectorRowForm (int *vect, int n, const char *notice) |
Function prints the vector of integers as row. More... | |
Collection of the functions of basic manipulations, some of them can be used instead of their counterparts defined as macros in 'macros.h'.
Definition in file elementaryFunctions.h.
#define _MATHEMATICA_SYNTAX_ 0 |
Definition at line 41 of file elementaryFunctions.h.
#define _STANDARD_SYNTAX_ 1 |
Definition at line 42 of file elementaryFunctions.h.