File size: 4,772 Bytes
10f2621 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | /**
* @defgroup Node Node class
* @brief Class Node: a node object.
*/
/**
* @file node.h
* @brief Class Node: a node object.
* @author Michael Holst
* @note None
* @version $Id: node.h,v 1.11 2010/08/12 05:18:22 fetk Exp $
*
* @attention
* @verbatim
*
* MC = < Manifold Code >
* Copyright (C) 1994-- Michael Holst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @endverbatim
*/
#ifndef _NODE_H_
#define _NODE_H_
#include <mc/mc_base.h>
#include <mc/bam.h>
/**
* @ingroup global_mc
* @author Michael Holst
* @brief Class Node: Parameters and datatypes
*/
typedef struct aNode {
/** @brief My id */
int myid;
/** @brief My vertex association (-1=none,else k>=0) */
int myvert;
/** @brief My node type (0=interior,odd=diri,even=neu) */
char type;
/** @brief My chart number */
char chart;
/** @brief number of coordinates for my chart */
char numx;
/** @brief My nodal coordinates (wrt my chart) */
double x[3];
/** @brief My nodal value */
double val;
} aNode;
/**
* @ingroup Node
* @brief Class Node: Definition
* @author Michael Holst
*/
struct sNode {
Vmem *vmem; /**< @brief the memory manager */
int iMadeVmem; /**< @brief did i make vmem or was it inherited */
int numR; /**< @brief the number of nodes */
aNode *data; /**< @brief vector data itself */
};
/**
* @ingroup Node
* @brief Declaration of the Node class as the Node structure
* @author Michael Holst
*/
typedef struct sNode Node;
#if !defined(VINLINE_APRX)
/**
* @ingroup Node
* @brief Return the number of nodes.
* @author Michael Holst
* @note Class Node: Inlineable methods (node.c)
* @return the number of nodes
* @param thee Pointer to a Node allocated memory location
*/
VEXTERNC int Node_numR(Node *thee);
/**
* @ingroup Node
* @brief Return a pointer to the node data.
* @author Michael Holst
* @note Class Node: Inlineable methods (node.c)
* @return a pointer to the node data.
* @param thee Pointer to a Node allocated memory location
*/
VEXTERNC aNode* Node_data(Node *thee);
#else /* if defined(VINLINE_APRX) */
/**
* @ingroup Node
* @brief Class Node: Inlineable methods (node.c) if defined(VINLINE_APRX)
* @author Michael Holst
* @note Class Node: Inlineable methods (node.c)
* @return the number of nodes
* @param thee Pointer to a Node allocated memory location
*/
# define Node_numR(thee) ((thee)->numR)
/**
* @ingroup Node
* @brief Class Node: Inlineable methods (node.c) if defined(VINLINE_APRX)
* @author Michael Holst
* @note Class Node: Inlineable methods (node.c)
* @return a pointer to the node data.
* @param thee Pointer to a Node allocated memory location
*/
# define Node_data(thee) ((thee)->data)
#endif /* if !defined(VINLINE_APRX) */
/**
* @ingroup Node
* @brief The node constructor.
* @author Michael Holst
* @note Class Node: Non-inlineable methods (node.c)
* @return Pointer to a Node allocated memory location
* @param vmem Memory management object
* @param pnumR num of rows in the matrix
*/
VEXTERNC Node* Node_ctor(Vmem *vmem, int pnumR);
/**
* @ingroup Node
* @brief The node destructor.
* @author Michael Holst
* @note Class Node: Non-inlineable methods (node.c)
* @param thee Pointer to a Node allocated memory location
*/
VEXTERNC void Node_dtor(Node **thee);
/**
* @ingroup Node
* @brief Print the exact current malloc usage.
* @author Michael Holst
* @note Class Node: Non-inlineable methods (node.c)
* @return none
* @param thee Pointer to a Node allocated memory location
*/
VEXTERNC void Node_memChk(Node *thee);
#endif /* _NODE_H_ */
|