matrix.h

Go to the documentation of this file.
00001 
00006 #if !defined(INC_OSKI_MATRIX_H) && !defined(OSKI_UNBIND)
00007 
00008 #define INC_OSKI_MATRIX_H
00009 
00010 #include <oski/common.h>
00011 #include <oski/matcommon.h>
00012 #include <oski/structhint.h>
00013 #include <oski/trace.h>
00014 
00015 #if defined(DO_NAME_MANGLING)
00016 
00018 #define oski_matstruct_t    MANGLE_(oski_matstruct_t)
00019 #define oski_matrix_t       MANGLE_(oski_matrix_t)
00020 #define const_oski_matrix_t      MANGLE_(const_oski_matrix_t)
00021 
00022 #define oski_CreateMatStruct  MANGLE_(oski_CreateMatStruct)
00023 #define oski_DestroyMatStruct MANGLE_(oski_DestroyMatStruct)
00024 
00025 #endif
00026 
00044 typedef struct
00045 {
00046   oski_matcommon_t props;   
00047   oski_matspecific_t input_mat;        
00048   int is_shared;    
00050   double time_stream;        
00052   oski_structhint_t structhints;    
00053   oski_trace_t workhints;          
00055   oski_trace_t trace;          
00056   oski_timer_t timer;          
00058   oski_matspecific_t tuned_mat;        
00059   char *tuned_xforms;       
00060 }
00061 oski_matstruct_t;
00062 
00066 typedef oski_matstruct_t *oski_matrix_t;
00067 
00072 typedef const oski_matstruct_t *const_oski_matrix_t;
00073 
00077 oski_matstruct_t *oski_CreateMatStruct (void);
00078 
00082 void oski_DestroyMatStruct (oski_matstruct_t * A);
00083 
00084 /* -------------------------------------------------------
00085  *  Diagnostics.
00086  */
00087 
00089 #define OSKI_CHECK_MAT_DIMS( m, n )   (((m) >= 0) && ((n) >= 0))
00090 
00092 #define OSKI_IS_SQUARE_MAT( m, n )  ((m) == (n))
00093 
00094 /* -------------------------------------------------------
00095  *  The matrix type module interface.
00096  */
00097 
00098 #include <oski/CSR/format.h>
00099 
00100 #if defined(DO_NAME_MANGLING)
00101 
00103 #define oski_DestroyMatRepr_funcpt \
00104     MANGLE_(oski_DestroyMatRepr_funcpt)
00105 #define oski_CreateMatReprFromCSR_funcpt \
00106     MANGLE_(oski_CreateMatReprFromCSR_funcpt)
00107 #define oski_CreateSubmatReprFromCSR_funcpt \
00108     MANGLE_(oski_CreateSubmatReprFromCSR_funcpt)
00109 #define oski_CopyMatRepr_funcpt \
00110     MANGLE_(oski_CopyMatRepr_funcpt)
00111 #define oski_CalcMatRepr1Norm_funcpt \
00112     MANGLE_(oski_CalcMatRepr1Norm_funcpt)
00113 #define oski_ConvertMatReprToCSR_funcpt \
00114         MANGLE_(oski_ConvertMatReprToCSR_funcpt)
00115 
00116 #define tagOski_submat_t MANGLE_(tagOski_submat_t)
00117 #define oski_submat_t    MANGLE_(oski_submat_t)
00118 
00119 #endif
00120 
00126 typedef struct tagOski_submat_t
00127 {
00128   oski_index_t i0;    
00129   oski_index_t j0;    
00130   oski_index_t num_rows;    
00131   oski_index_t num_cols;    
00132 }
00133 oski_submat_t;
00134 
00138 typedef void (*oski_DestroyMatRepr_funcpt) (void *mat);
00139 
00143 #if 1
00144 typedef void *(*oski_CreateMatReprFromCSR_funcpt) (const oski_matCSR_t * mat,
00145                            const oski_matcommon_t *
00146                            props, ...);
00147 #endif
00148 
00155 typedef void *(*oski_CreateSubmatReprFromCSR_funcpt) (const oski_matCSR_t *
00156                               mat,
00157                               const oski_matcommon_t *
00158                               props,
00159                               const oski_submat_t *
00160                               sub, ...);
00161 
00165 typedef oski_matCSR_t *(*oski_ConvertMatReprToCSR_funcpt) (const void *,
00166                                const
00167                                oski_matcommon_t *
00168                                props);
00169 
00173 typedef void *(*oski_CopyMatRepr_funcpt) (const void *,
00174                       const oski_matcommon_t * props);
00175 
00179 typedef double (*oski_CalcMatRepr1Norm_funcpt) (const void *mat,
00180                         const oski_matcommon_t *
00181                         props);
00182 
00183 /* ----- Generic (matrix type-independent) kernel implementations ----- */
00184 
00190 #include <oski/matmult.h>
00191 #include <oski/ata.h>
00192 #include <oski/trisolve.h>
00193 #include <oski/a_and_at.h>
00194 #include <oski/matpow.h>
00195 
00198 #endif /* !defined(INC_OSKI_MATRIX_H) */
00199 
00200 #if defined(OSKI_UNBIND)
00201 #  include <oski/matcommon.h>
00202 #  include <oski/trace.h>
00203 #  include <oski/CSR/format.h>
00204 #  undef INC_OSKI_MATRIX_H
00205 #  undef oski_matstruct_t
00206 #  undef oski_matrix_t
00207 #  undef const_oski_matrix_t
00208 #  undef oski_CreateMatStruct
00209 #  undef oski_DestroyMatStruct
00210 #  undef OSKI_CHECK_MAT_DIMS
00211 #  undef OSKI_IS_SQUARE_MAT
00212 #  undef oski_DestroyMatRepr_funcpt
00213 #  undef oski_CreateMatReprFromCSR_funcpt
00214 #  undef oski_CreateSubmatReprFromCSR_funcpt
00215 #  undef oski_CopyMatRepr_funcpt
00216 #  undef oski_CalcMatRepr1Norm_funcpt
00217 #  undef tagOski_submat_t
00218 #  undef oski_submat_t
00219 #endif
00220 
00221 /* eof */

Generated on Wed Sep 19 16:41:18 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6