#include <vector>
#include <iostream>
#include <sstream>
#include <string>
Go to the source code of this file.
Functions |
float | strToFloat (std::string &str) |
| Converts a string to float.
|
std::string | intToStr (int i) |
void | printVec (std::vector< float > &vec) |
| Prints the given vector to the standard-output.
|
void | printMat (std::vector< std::vector< float > > &mat) |
| Prints the given matrix to the standard-output.
|
void | matMult (std::vector< std::vector< float > > &mat, std::vector< float > &vec, std::vector< float > &res) |
| Multiplies the matrix mat with the vector vec and saves the result in the vector res.
|
void | vecAdd (std::vector< float > &vec1, std::vector< float > &vec2, std::vector< float > &res) |
| Adds the vectores vec1 and vec2 and saves the result in the vector res.
|
Detailed Description
Util.h contains some often used functions.
- Author:
- Daniel Wunderlich (d.wunderlich@stud.uni-heidelberg.de)
- Version:
- 0.8
- Date:
- 2011-01-26
Function Documentation
std::string intToStr |
( |
int |
i | ) |
|
void matMult |
( |
std::vector< std::vector< float > > & |
mat, |
|
|
std::vector< float > & |
vec, |
|
|
std::vector< float > & |
res |
|
) |
| |
Multiplies the matrix mat with the vector vec and saves the result in the vector res.
- Parameters:
-
mat | The matrix, which should be multiplied. |
vec | The vector, which should be multiplied. |
res | The vector the result should be saved in. |
void printMat |
( |
std::vector< std::vector< float > > & |
mat | ) |
|
Prints the given matrix to the standard-output.
- Parameters:
-
mat | The matrix, which should be printed. |
void printVec |
( |
std::vector< float > & |
vec | ) |
|
Prints the given vector to the standard-output.
- Parameters:
-
vec | The vector, which should be printed. |
float strToFloat |
( |
std::string & |
str | ) |
|
Converts a string to float.
- Parameters:
-
str | The string, which should be converted. |
- Returns:
- The converted float.
void vecAdd |
( |
std::vector< float > & |
vec1, |
|
|
std::vector< float > & |
vec2, |
|
|
std::vector< float > & |
res |
|
) |
| |
Adds the vectores vec1 and vec2 and saves the result in the vector res.
- Parameters:
-
vec1 | The first vector, which should be added. |
vec2 | The second vector, which should be added. |
res | The vector the result should be saved in. |