Clustal Omega  1.2.4
symmatrix.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Clustal Omega - Multiple sequence alignment
3  *
4  * Copyright (C) 2010 University College Dublin
5  *
6  * Clustal-Omega is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This file is part of Clustal-Omega.
12  *
13  ********************************************************************/
14 
15 /*
16  * RCS $Id: symmatrix.h 288 2013-07-29 13:15:50Z andreas $
17  */
18 
36 #ifndef CLUSTALO_SYMMATRIX_H
37 #define CLUSTALO_SYMMATRIX_H
38 
39 /* ugly, but necessary for cross-checking of names in distmat and
40  * mseq */
41 #include "seq.h"
42 
43 
44 
48 typedef struct {
49  int nrows;
50  int ncols;
59  double **data;
60 } symmatrix_t;
61 
62 
63 
64 extern int
65 NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols);
66 
67 extern void
68 SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value);
69 
70 extern double
71 SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j);
72 
73 extern void
74 SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j);
75 
76 extern void
77 FreeSymMatrix(symmatrix_t **symmat);
78 
79 extern void
80 SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path, bool bPercID);
81 
82 extern int
83 SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq);
84 
85 #endif
NewSymMatrix
int NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols)
Allocates symmat and its members and initialises them. Data will be calloced, i.e....
Definition: symmatrix.c:68
mseq_t
structure for storing multiple sequences
Definition: seq.h:47
SymMatrixGetValue
double SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j)
Returns element of symmat corresponding to given indices.
Definition: symmatrix.c:209
seq.h
FreeSymMatrix
void FreeSymMatrix(symmatrix_t **symmat)
Frees memory allocated by data members of symmat and symmat itself.
Definition: symmatrix.c:277
SymMatrixGetValueP
void SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j)
Returns a pointer to an element of symmat corresponding to given indices.
Definition: symmatrix.c:248
SymMatrixSetValue
void SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value)
Sets symmat data of given index to given value.
Definition: symmatrix.c:176
SymMatrixRead
int SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq)
Read a distance matrix in phylip format.
Definition: symmatrix.c:399
symmatrix_t
symmetric matrix structure
Definition: symmatrix.h:48
SymMatrixPrint
void SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path, bool bPercID)
Print out a symmat in phylip style. Distances are printed on one line per sequence/object....
Definition: symmatrix.c:316