00001 /*************************************************************************** 00002 * @file gnn_prototype.h 00003 * @brief Prototype Node Header File. 00004 * 00005 * @date : 17-09-03 20:52 00006 * @author : Pedro Ortega C. <peortega@dcc.uchile.cl> 00007 * Copyright 2003 Pedro Ortega C. 00008 ****************************************************************************/ 00009 /* 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _GNN_PROTOTYPE_H_ 00026 #define _GNN_PROTOTYPE_H_ 00027 00028 /******************************************/ 00029 /* Include Files */ 00030 /******************************************/ 00031 00032 #include <gsl/gsl_matrix.h> 00033 #include "gnn_node.h" 00034 00035 00036 00037 /******************************************/ 00038 /* Typedefs */ 00039 /******************************************/ 00040 00041 /** 00042 * @brief The structure for a \ref gnn_prototype node. 00043 * @ingroup gnn_prototype_doc 00044 * 00045 * This datatype holds the information for a \ref gnn_prototype node. 00046 * Basically, it extends the \ref gnn_node with special pointers to get fast 00047 * accesses to the prototype matrix. 00048 */ 00049 typedef struct _gnn_prototype gnn_prototype; 00050 00051 struct _gnn_prototype 00052 { 00053 gnn_node node; /**< The underlying \ref gnn_node. */ 00054 00055 gsl_vector *y; /**< A buffer of the outputs. */ 00056 gsl_vector *row; /**< Prototype (row) buffer. */ 00057 gsl_vector *col; /**< Column buffer. */ 00058 00059 gsl_matrix_view D_view; /**< View of matrix A. */ 00060 gsl_matrix_view dD_view; /**< View of matrix dA. */ 00061 gsl_matrix_int_view Df_view; /**< View of flags for A. */ 00062 00063 gsl_matrix *D; /**< Pointer to matrix A. */ 00064 gsl_matrix *dD; /**< Pointer to matrix dA. */ 00065 gsl_matrix_int *Df; /**< Pointer to flags for A. */ 00066 00067 }; 00068 00069 00070 /******************************************/ 00071 /* Public Interface */ 00072 /******************************************/ 00073 00074 gnn_node * 00075 gnn_prototype_new (size_t input_size, size_t output_size, 00076 double min, double max); 00077 00078 gnn_node * 00079 gnn_prototype_standard_new (size_t input_size, size_t output_size); 00080 00081 int 00082 gnn_prototype_vector_freeze (gnn_node *node, size_t j); 00083 00084 int 00085 gnn_prototype_vector_unfreeze (gnn_node *node, size_t j); 00086 00087 int 00088 gnn_prototype_vector_set (gnn_node *node, size_t j, const gsl_vector *v); 00089 00090 int 00091 gnn_prototype_vector_get (gnn_node *node, size_t j, gsl_vector *v); 00092 00093 00094 00095 #endif /* _GNN_PROTOTYPE_H_ */ 00096
1.2.18