generated from freudenreichan/info2Praktikum-NeuronalesNetz
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ff09b0ee6 | ||
|
|
ac8c827b37 | ||
|
|
0ac4b64866 | ||
|
|
7acece0571 | ||
|
|
44b77815b3 |
No files matched your search
@@ -19,4 +19,11 @@ GrayScaleImageSeries *readImages(const char *path)
|
||||
// TODO Vervollständigen Sie die Funktion clearSeries, welche eine Bildserie vollständig aus dem Speicher freigibt
|
||||
void clearSeries(GrayScaleImageSeries *series)
|
||||
{
|
||||
for(size_t i = GrayScaleImageSeries.count - 1; i >= 0; i--)
|
||||
{
|
||||
free(GrayScaleImageSeries.images+GrayScaleImageSeries.count*sizeof(GrayScaleImage)*i);
|
||||
free(GrayScaleImageSeries.labels+GrayScaleImageSeries.count*sizeof(unsigned char)*i);
|
||||
}
|
||||
GrayScaleImageSeries.images = NULL;
|
||||
GrayScaleImageSeries.labels = NULL;
|
||||
}
|
||||
@@ -13,12 +13,17 @@ typedef struct Matrix {
|
||||
|
||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||
{
|
||||
|
||||
Matrix newMatrix;
|
||||
newMatrix.rows = rows;
|
||||
newMatrix.cols = cols;
|
||||
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType))
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
void clearMatrix(Matrix *matrix)
|
||||
{
|
||||
|
||||
free(*matrix.buffer);
|
||||
*matrix.buffer = NULL;
|
||||
}
|
||||
|
||||
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
|
||||
|
||||
Reference in new issue
Block a user