Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

gnn_node_vector.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *  @file gnn_node_vector.h
00003  *  @brief gnn_node_vector Header File.
00004  *
00005  *  @date   : 30-09-03 19:38
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_NODE_VECTOR_H_
00026 #define _GNN_NODE_VECTOR_H_
00027 
00028 /******************************************/
00029 /* Typedefs                               */
00030 /******************************************/
00031 
00032 typedef struct _gnn_node_vector gnn_node_vector;
00033 
00034 struct _gnn_node_vector
00035 {
00036     size_t size;
00037     size_t stride;
00038     size_t blocksize;
00039     gnn_node **data;
00040     int owner;
00041 };
00042 
00043 typedef struct _gnn_node_vector_view gnn_node_vector_view;
00044 
00045 struct _gnn_node_vector_view
00046 {
00047     gnn_node_vector vector;
00048 };
00049 
00050 
00051 
00052 /******************************************/
00053 /* Public Interface                       */
00054 /******************************************/
00055 
00056 gnn_node_vector *
00057 gnn_node_vector_new (size_t size);
00058 
00059 void
00060 gnn_node_vector_free (gnn_node_vector *v);
00061 
00062 void
00063 gnn_node_vector_destroy_all (gnn_node_vector *v);
00064 
00065 gnn_node *
00066 gnn_node_vector_get (gnn_node_vector *v, size_t i);
00067 
00068 int
00069 gnn_node_vector_set (gnn_node_vector *v, size_t i, gnn_node *n);
00070 
00071 int
00072 gnn_node_vector_isnull (gnn_node_vector *v);
00073 
00074 size_t
00075 gnn_node_vector_count_nodes (gnn_node_vector *v);
00076 
00077 int
00078 gnn_node_vector_swap (gnn_node_vector *v, gnn_node_vector *w);
00079 
00080 int
00081 gnn_node_vector_swap_elements (gnn_node_vector *v, size_t i, size_t j);
00082 
00083 int
00084 gnn_node_vector_reverse (gnn_node_vector *v);
00085 
00086 gnn_node_vector *
00087 gnn_node_vector_dup (gnn_node_vector *v);
00088 
00089 int
00090 gnn_node_vector_copy (gnn_node_vector *v, const gnn_node_vector *w);
00091 
00092 
00093 
00094 /* Views */
00095 
00096 gnn_node_vector_view
00097 gnn_node_vector_subvector (gnn_node_vector *v, size_t i, size_t n);
00098 
00099 gnn_node_vector_view
00100 gnn_node_vector_subvector_with_stride (gnn_node_vector *v,
00101                                        size_t i,
00102                                        size_t stride,
00103                                        size_t n);
00104 
00105 
00106 #endif /* _GNN_NODE_VECTOR_H_ */
00107 

Generated on Sun Jun 13 20:50:12 2004 for libgnn Gradient Retropropagation Machine Library by doxygen1.2.18