muMECH  1.0
Namespaces | Macros | Functions
elementaryFunctions.cpp File Reference
#include <math.h>
#include "macros.h"
#include "elementaryFunctions.h"
#include "types.h"
#include "gelib.h"
#include <string.h>

Go to the source code of this file.

Namespaces

 mumech
 

Macros

#define _at(mtrx, i, j, n)   mtrx[i * n + j]
 

Functions

double mumech::giveVectorLength (const double *point_1, const double *point_2)
 
*** 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

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 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::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...
 
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...
 

Macro Definition Documentation

#define _at (   mtrx,
  i,
  j,
 
)    mtrx[i * n + j]