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
48typedef struct {
49 int nrows;
50 int ncols;
59 double **data;
61
62
63
64extern int
65NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols);
66
67extern void
68SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value);
69
70extern double
71SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j);
72
73extern void
74SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j);
75
76extern void
78
79extern void
80SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path, bool bPercID);
81
82extern int
83SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq);
84
85#endif
structure for storing multiple sequences
Definition seq.h:47
symmetric matrix structure
Definition symmatrix.h:48
int ncols
Definition symmatrix.h:50
int nrows
Definition symmatrix.h:49
double ** data
Definition symmatrix.h:59
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
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
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
double SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j)
Returns element of symmat corresponding to given indices.
Definition symmatrix.c:209
int SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq)
Read a distance matrix in phylip format.
Definition symmatrix.c:399
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
void FreeSymMatrix(symmatrix_t **symmat)
Frees memory allocated by data members of symmat and symmat itself.
Definition symmatrix.c:277