/* partition.h - Routines to help handle partitioned matrices. * (C) Copyright 1999 by John Halleck * All rights reserved. */ /* Version of September 6th, 1999 */ /* These routines support some basic operations needed for matrix * partitioning. You can extract or place a submatrix, or you * can add or subtract a part of a matrix. */ #ifndef PARTITION #define PARTITION 1 #include "errors.h" /* We return package standard error codes. */ /* All of the routines can return: * ERRnil - You can't pass nil pointers to the routines. * ERRsize - Matrices have to have positive numbers of rows and columns. * ERRrange - The indices were out of range. * ERRsame - The arrays have to be distinct arrays. */ #include "mat.h" /* What does a matrix look like? */ /* -------------- Routines ---------------------------- */ /* Embed one matrix into another */ extern error matembed (int rows, int cols, matrix result, int rowsfrom, int colsfrom, matrix from, int atrow, int atcol); /* Extract one matrix from another */ extern error matextract (int rows, int cols, matrix result, int rowsfrom, int colsfrom, matrix from, int offsetrow, int offsetcol); /* Add a matrix to a section of another. */ extern error partadd (int rows, int cols, matrix result, int rowsfrom, int colsfrom, matrix from, int offsetrow, int offsetcol); /* subtract a matrix from a section of another. */ extern error partsub (int rows, int cols, matrix result, int rowsfrom, int colsfrom, matrix from, int offsetrow, int offsetcol); #endif