Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
convert.c File Reference

Some utilities for format conversion. More...

#include "fasp.h"
#include "fasp_functs.h"

Go to the source code of this file.

Functions

unsigned long fasp_aux_change_endian4 (unsigned long x)
 Swap order for different endian systems. More...
 
double fasp_aux_change_endian8 (double x)
 Swap order for different endian systems. More...
 
double fasp_aux_bbyteToldouble (unsigned char bytes[])
 Swap order of double-precision float for different endian systems. More...
 
INT endian_convert_int (const INT inum, const INT ilength, const INT endianflag)
 Swap order of an INT number. More...
 
REAL endian_convert_real (const REAL rnum, const INT vlength, const INT endianflag)
 Swap order of a REAL number. More...
 

Detailed Description

Some utilities for format conversion.

Definition in file convert.c.

Function Documentation

INT endian_convert_int ( const INT  inum,
const INT  ilength,
const INT  endianflag 
)

Swap order of an INT number.

Parameters
inumAn INT value
ilengthLength of INT: 2 for short, 4 for int, 8 for long
endianflagIf endianflag = 1, it returns inum itself If endianflag = 2, it returns the swapped inum
Returns
Value of inum or swapped inum
Author
Ziteng Wang
Date
2012-12-24

Definition at line 105 of file convert.c.

REAL endian_convert_real ( const REAL  rnum,
const INT  ilength,
const INT  endianflag 
)

Swap order of a REAL number.

Parameters
rnumAn REAL value
ilengthLength of INT: 2 for short, 4 for int, 8 for long
endianflagIf endianflag = 1, it returns rnum itself If endianflag = 2, it returns the swapped rnum
Returns
Value of rnum or swapped rnum
Author
Ziteng Wang
Date
2012-12-24

Definition at line 137 of file convert.c.

double fasp_aux_bbyteToldouble ( unsigned char  bytes[])

Swap order of double-precision float for different endian systems.

Parameters
bytesA unsigned char
Returns
Unsigend long ineger after swapping
Author
Chensong Zhang
Date
11/16/2009

Definition at line 74 of file convert.c.

unsigned long fasp_aux_change_endian4 ( unsigned long  x)

Swap order for different endian systems.

Parameters
xAn unsigned long integer
Returns
Unsigend long ineger after swapping
Author
Chensong Zhang
Date
11/16/2009

Definition at line 25 of file convert.c.

double fasp_aux_change_endian8 ( double  x)

Swap order for different endian systems.

Parameters
xA unsigned long integer
Returns
Unsigend long ineger after swapping
Author
Chensong Zhang
Date
11/16/2009

Definition at line 43 of file convert.c.