Main Page | Modules | Alphabetical List | Class List | Directories | Class Members

Two vectors object


Functions

cpl_bivector * cpl_bivector_new (int n)
 Create a new cpl_bivector.
cpl_bivector * cpl_bivector_wrap_vectors (cpl_vector *x, cpl_vector *y)
 Create a new cpl_bivector from two cpl_vector.
cpl_bivector * cpl_bivector_duplicate (cpl_bivector *in)
 Duplicate a cpl_bivector.
void cpl_bivector_delete (cpl_bivector *f)
 Delete a cpl_bivector.
void cpl_bivector_unwrap_vectors (cpl_bivector *f)
 Free memory associated to an cpl_bivector, excluding the two vectors.
void cpl_bivector_dump (cpl_bivector *f, FILE *out)
 Dump a cpl_bivector in a file or stdout.
cpl_bivector * cpl_bivector_load (char *filename)
 Read a list of points from an ASCII file, create cpl_bivector.
int cpl_bivector_get_size (const cpl_bivector *in)
 Get the size of the cpl_bivector.
cpl_vector * cpl_bivector_get_x (const cpl_bivector *in)
 Get a pointer to the x vector of the cpl_bivector.
cpl_vector * cpl_bivector_get_y (const cpl_bivector *in)
 Get a pointer to the y vector of the cpl_bivector.
double * cpl_bivector_get_x_data (const cpl_bivector *in)
 Get a pointer to the x data part of the cpl_bivector.
double * cpl_bivector_get_y_data (const cpl_bivector *in)
 Get a pointer to the y data part of the cpl_bivector.
cpl_error_code cpl_bivector_interpolate_linear (cpl_bivector *fout, const cpl_bivector *fref)
 Linear interpolation of a 1d-function.

Detailed Description

This module provides functions to handle cpl_bivector.

A cpl_bivector is composed of two vectors of the same size. It can be used to store 1d functions, with the x and y positions of the samples, offsets in x and y or simply positions in an image.

This module provides the possibility to compute a local maximum, to cross-correlate two signals, etc...

Synopsis:
   #include "cpl_bivector.h"

Function Documentation

void cpl_bivector_delete cpl_bivector *  f  ) 
 

Delete a cpl_bivector.

Parameters:
f cpl_bivector to delete
Returns:
void

void cpl_bivector_dump cpl_bivector *  f,
FILE *  out
 

Dump a cpl_bivector in a file or stdout.

Parameters:
f cpl_bivector to dump
out File where the cpl_bivector is written
Returns:
void
Dump a cpl_bivector in a file specified by the second parameter. It accepts stdout or stderr.

cpl_bivector* cpl_bivector_duplicate cpl_bivector *  in  ) 
 

Duplicate a cpl_bivector.

Parameters:
in cpl_bivector to duplicate
Returns:
1 newly allocated cpl_bivector or NULL in error case
The returned object must be deallocated using cpl_bivector_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

int cpl_bivector_get_size const cpl_bivector *  in  ) 
 

Get the size of the cpl_bivector.

Parameters:
in the input bivector
Returns:
The size or a negative number in error case
Possible _cpl_error_code_ set in this function:
  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input bivector contains vectors of different sizes

cpl_vector* cpl_bivector_get_x const cpl_bivector *  in  ) 
 

Get a pointer to the x vector of the cpl_bivector.

Parameters:
in a cpl_bivector
Returns:
Pointer to the x vector or NULL in error case
The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

double* cpl_bivector_get_x_data const cpl_bivector *  in  ) 
 

Get a pointer to the x data part of the cpl_bivector.

Parameters:
in a cpl_bivector
Returns:
Pointer to the double x array or NULL in error case
The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

cpl_vector* cpl_bivector_get_y const cpl_bivector *  in  ) 
 

Get a pointer to the y vector of the cpl_bivector.

Parameters:
in a cpl_bivector
Returns:
Pointer to the y vector or NULL in error case
The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

double* cpl_bivector_get_y_data const cpl_bivector *  in  ) 
 

Get a pointer to the y data part of the cpl_bivector.

Parameters:
in a cpl_bivector
Returns:
Pointer to the double y array or NULL in error case
The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL

cpl_error_code cpl_bivector_interpolate_linear cpl_bivector *  fout,
const cpl_bivector *  fref
 

Linear interpolation of a 1d-function.

Parameters:
fref Reference 1d-function
fout Preallocated 1d-function to contain result
Returns:
CPL_ERROR_NONE or the relevant _cpl_error_code_
fref must have both its abscissa and ordinate defined. fout must have its abscissa defined and its ordinate allocated.

The linear interpolation will be done from the values in fref to the abscissa points in fout.

The abscissa points of both fref and fout must be growing, x_i < x_i+1.

The abscissa points of fout must be in range of those of fref (i.e. extrapolation is not allowed).

fref must be of at least length 2 while fout must be at least of length 1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if one of the requirements on the 2 input bivectors is not respected.

cpl_bivector* cpl_bivector_load char *  filename  ) 
 

Read a list of points from an ASCII file, create cpl_bivector.

Parameters:
filename Name of the input ASCII file
Returns:
1 newly allocated cpl_bivector or NULL in error case
Parse an input ASCII file values and fill a newly created cpl_bivector with it. Lines beginning with a hash are ignored, blank lines also. The returned object must be deallocated using cpl_bivector_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_FILE_IO if the input filename is NULL

cpl_bivector* cpl_bivector_new int  n  ) 
 

Create a new cpl_bivector.

Parameters:
n Number of points
Returns:
1 newly allocated cpl_bivector or NULL in error case
The returned object must be deallocated using cpl_bivector_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if n is <= 0

void cpl_bivector_unwrap_vectors cpl_bivector *  f  ) 
 

Free memory associated to an cpl_bivector, excluding the two vectors.

Parameters:
f cpl_bivector to delete
Returns:
void

cpl_bivector* cpl_bivector_wrap_vectors cpl_vector *  x,
cpl_vector *  y
 

Create a new cpl_bivector from two cpl_vector.

Parameters:
x the x cpl_vector
y the y cpl_vector
Returns:
1 cpl_bivector or NULL in error case
The returned object must be deallocated using cpl_bivector_delete() and the passed vectors do not need to be deallocated any more.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input vectors have different sizes


Generated on Thu Apr 7 15:16:18 2005 for Common Pipeline Library Reference Manual by  doxygen 1.4.1