767 |
boolean accurate; /**< Is vector currently accurate? User-manipulated. */ |
boolean accurate; /**< Is vector currently accurate? User-manipulated. */ |
768 |
}; |
}; |
769 |
|
|
770 |
extern struct vector_data *slv_create_vector(int32 low, int32 high); |
ASC_DLLSPEC(struct vector_data *) slv_create_vector(int32 low, int32 high); |
771 |
/**< |
/**< |
772 |
* Returns a new vector_data initialized to the specified range. |
* Returns a new vector_data initialized to the specified range. |
773 |
* This function creates, initializes, and returns a new vector_data |
* This function creates, initializes, and returns a new vector_data |
785 |
* not be created. |
* not be created. |
786 |
*/ |
*/ |
787 |
|
|
788 |
extern int slv_init_vector(struct vector_data *vec, int32 low, int32 high); |
ASC_DLLSPEC(int) slv_init_vector(struct vector_data *vec, int32 low, int32 high); |
789 |
/**< |
/**< |
790 |
* Initializes a vector_data structure. |
* Initializes a vector_data structure. |
791 |
* The new range (low..high) is considered proper if both low and |
* The new range (low..high) is considered proper if both low and |
806 |
* and 3 if memory cannot be allocated. |
* and 3 if memory cannot be allocated. |
807 |
*/ |
*/ |
808 |
|
|
809 |
extern void slv_destroy_vector(struct vector_data *vec); |
ASC_DLLSPEC(void) slv_destroy_vector(struct vector_data *vec); |
810 |
/**< |
/**< |
811 |
* Destroys a vector and its assocated data. |
* Destroys a vector and its assocated data. |
812 |
* Deallocates any memory held in vec->rng and vec->vec, |
* Deallocates any memory held in vec->rng and vec->vec, |
816 |
* @param vec Pointer to the vector_data to destroy. |
* @param vec Pointer to the vector_data to destroy. |
817 |
*/ |
*/ |
818 |
|
|
819 |
extern void slv_zero_vector(struct vector_data *vec); |
ASC_DLLSPEC(void) slv_zero_vector(struct vector_data *vec); |
820 |
/**< |
/**< |
821 |
* Zeroes a vector. |
* Zeroes a vector. |
822 |
* The vector entries between vec->rng.low and vec->rng.high will |
* The vector entries between vec->rng.low and vec->rng.high will |
831 |
* @param vec The vector to zero. |
* @param vec The vector to zero. |
832 |
*/ |
*/ |
833 |
|
|
834 |
extern void slv_copy_vector(struct vector_data *srcvec, |
ASC_DLLSPEC(void) slv_copy_vector(struct vector_data *srcvec, |
835 |
struct vector_data *destvec); |
struct vector_data *destvec); |
836 |
/**< |
/**< |
837 |
* Copies the data from srcvec to destvec. |
* Copies the data from srcvec to destvec. |
853 |
* @param destvec The vector to receive the copied data. |
* @param destvec The vector to receive the copied data. |
854 |
*/ |
*/ |
855 |
|
|
856 |
extern real64 slv_inner_product(struct vector_data *vec1, |
ASC_DLLSPEC(real64) slv_inner_product(struct vector_data *vec1, |
857 |
struct vector_data *vec2); |
struct vector_data *vec2); |
858 |
/**< |
/**< |
859 |
* Calculates the dot product of 2 vectors. |
* Calculates the dot product of 2 vectors. |
875 |
* @todo solver/slv_common:slv_inner_product() could stand to be optimized. |
* @todo solver/slv_common:slv_inner_product() could stand to be optimized. |
876 |
*/ |
*/ |
877 |
|
|
878 |
extern real64 slv_square_norm(struct vector_data *vec); |
ASC_DLLSPEC(real64) slv_square_norm(struct vector_data *vec); |
879 |
/**< |
/**< |
880 |
* Calculates the dot product of a vector with itself. |
* Calculates the dot product of a vector with itself. |
881 |
* Dot [vec->rng.low .. vec->rng.high] with itself and store the |
* Dot [vec->rng.low .. vec->rng.high] with itself and store the |
891 |
* @todo solver/slv_common:slv_square_norm() could stand to be optimized. |
* @todo solver/slv_common:slv_square_norm() could stand to be optimized. |
892 |
*/ |
*/ |
893 |
|
|
894 |
extern void slv_matrix_product(mtx_matrix_t mtx, |
ASC_DLLSPEC(void) slv_matrix_product(mtx_matrix_t mtx, |
895 |
struct vector_data *vec, |
struct vector_data *vec, |
896 |
struct vector_data *prod, |
struct vector_data *prod, |
897 |
real64 scale, |
real64 scale, |
944 |
* ---------------------------- |
* ---------------------------- |
945 |
*/ |
*/ |
946 |
|
|
947 |
extern real64 slv_dot(int32 len, const real64 *a1, const real64 *a2); |
ASC_DLLSPEC(real64) slv_dot(int32 len, const real64 *a1, const real64 *a2); |
948 |
/**< |
/**< |
949 |
* Calculates the dot product of 2 arrays of real64. |
* Calculates the dot product of 2 arrays of real64. |
950 |
* This is an optimized routine (loop unrolled). It takes |
* This is an optimized routine (loop unrolled). It takes |
970 |
* -------------------------------- |
* -------------------------------- |
971 |
*/ |
*/ |
972 |
|
|
973 |
extern FILE *slv_get_output_file(FILE *fp); |
ASC_DLLSPEC(FILE *)slv_get_output_file(FILE *fp); |
974 |
/**< |
/**< |
975 |
* Checks a file pointer, and if NULL returns a pointer to the nul device. |
* Checks a file pointer, and if NULL returns a pointer to the nul device. |
976 |
* If you are in environment that doesn't have something like |
* If you are in environment that doesn't have something like |
1216 |
* -------------------- |
* -------------------- |
1217 |
*/ |
*/ |
1218 |
|
|
1219 |
extern int32 **slv_create_lnkmap(int32 m, int32 n, int32 hl, int32 *hi, int32 *hj); |
ASC_DLLSPEC(int32 **) slv_create_lnkmap(int32 m, int32 n, int32 hl, int32 *hi, int32 *hj); |
1220 |
/**< |
/**< |
1221 |
* Builds a row-biased mapping array from the hi,hj lists given. |
* Builds a row-biased mapping array from the hi,hj lists given. |
1222 |
* The map returned has the following format: |
* The map returned has the following format: |
1256 |
* @return Pointer to the new lnkmap array, or NULL if an error occurred. |
* @return Pointer to the new lnkmap array, or NULL if an error occurred. |
1257 |
*/ |
*/ |
1258 |
|
|
1259 |
extern int32 **slv_lnkmap_from_mtx(mtx_matrix_t mtx, mtx_region_t *region); |
ASC_DLLSPEC(int32 **) slv_lnkmap_from_mtx(mtx_matrix_t mtx, mtx_region_t *region); |
1260 |
/**< |
/**< |
1261 |
* Generates a lnkmap from a region of a matrix. |
* Generates a lnkmap from a region of a matrix. |
1262 |
* The length of the map returned will be the order of mtx. Empty rows |
* The length of the map returned will be the order of mtx. Empty rows |
1279 |
* @see slv_create_lnkmap() for a more details about lnkmaps. |
* @see slv_create_lnkmap() for a more details about lnkmaps. |
1280 |
*/ |
*/ |
1281 |
|
|
1282 |
extern void slv_destroy_lnkmap(int32 **map); |
ASC_DLLSPEC(void) slv_destroy_lnkmap(int32 **map); |
1283 |
/**< |
/**< |
1284 |
* Deallocate a map created by slv_create_lnkmap() or slv_destroy_lnkmap(). |
* Deallocate a map created by slv_create_lnkmap() or slv_destroy_lnkmap(). |
1285 |
* destroy_lnkmap() will tolerate a NULL map as input. |
* destroy_lnkmap() will tolerate a NULL map as input. |
1287 |
* @param map The lnkmap to destroy. |
* @param map The lnkmap to destroy. |
1288 |
*/ |
*/ |
1289 |
|
|
1290 |
extern void slv_write_lnkmap(FILE *fp, int m, int32 **map); |
ASC_DLLSPEC(void) slv_write_lnkmap(FILE *fp, int m, int32 **map); |
1291 |
/**< |
/**< |
1292 |
* Prints a link map to a file. |
* Prints a link map to a file. |
1293 |
* write_lnkmap() will tolerate a NULL map as input. |
* write_lnkmap() will tolerate a NULL map as input. |