Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93502485
al_sq_dbl.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 06:49
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Dec 1, 06:49 (2 d)
Engine
blob
Format
Raw Data
Handle
22652104
Attached To
R1448 Lenstool-HPC
al_sq_dbl.c
View Options
/**********************************************************/
/* */
/* FUNCTION: alloc_square_double */
/* */
/* PURPOSE: Allocates a square of double in memory */
/* */
/* INPUT: nbr_lin = number of lines */
/* nbr_col = number of columns */
/* */
/* RETURN: square = pointer to matrix of pointers */
/* (NULL if memory allocation failure) */
/* */
/* VERSION: 1.1 March 1992 */
/* */
/* AUTHOR: Karim BOUYOUCEF */
/* */
/**********************************************************/
#include <stdlib.h>
#include "lt.h"
/**********************************************************/
/* Allocate an array of double values of size[nbr_lin][nbr_col]
*/
double **alloc_square_double(int nbr_lin,int nbr_col)
{
auto double **square;
register int i, j;
square = (double **) malloc((unsigned) nbr_lin*sizeof(double *));
if (square != 0)
{
for (i=0; i<nbr_lin; i++)
{
square[i] = (double *)malloc((unsigned) nbr_col*sizeof(double));
if (square[i] == 0) square = 0;
}
}
for (i=0; i<nbr_lin; i++)
for (j=0; j<nbr_col; j++)
square[i][j]=0.0;
return(square);
}
Event Timeline
Log In to Comment