runtime_error(
"mismatch between number of labels " 60 "and number of distances");
65 for(
size_tj = 0; j < sz; ++j) {
66 for(
size_t i= j + 1;
i< sz; ++
i) {
78 throwruntime_error(
"matrix is not square");
81 for(
size_t i= 0;
i< sz; ++
i) {
82 if(mat(
i,
i) != 0) {
83 throwruntime_error(
"element on main diagonal is nonzero");
85 for(
size_tj = 0; j < sz; ++j) {
86 if(mat(
i, j) != mat(j,
i)) {
87 throwruntime_error(
"matrix is not symmetric");
94 for(
size_tj = 0; j < sz; ++j) {
95 for(
size_t i= j + 1;
i< sz; ++
i) {
110 catch(std::exception&) {
111istr.seekg(init_pos);
117 catch(std::exception&) {
118istr.seekg(init_pos);
129vector<string>
names;
130vector<vector<double> > values;
132 for(
unsigned int i= 0;
i< dim; ++
i) {
133 unsigned int count= 0;
134vector<double> line_values;
135 unsigned intmin_expected_cols, max_expected_cols;
137min_expected_cols = dim;
138max_expected_cols = dim;
140min_expected_cols =
i;
141max_expected_cols =
i+ 1;
143min_expected_cols = dim -
i;
144max_expected_cols = dim -
i;
146 throwruntime_error(
"invald matrix format specified");
151 throwruntime_error(
"unexpected EOF");
154 throwruntime_error(
"problem reading file");
158 names.push_back(name);
159line = line.substr(10);
163 ITERATE(list<string>, field, fields) {
166 if(line_values.size() > max_expected_cols) {
167 throwruntime_error(
"too many columns in row");
169 if(line_values.size() >= min_expected_cols) {
174values.push_back(line_values);
177 for(
unsigned int i= 0;
i< dim; ++
i) {
178 for(
unsigned intj = 0; j < dim; ++j) {
180mat(
i, j) = values[
i][j];
183mat(
i, j) = values[j][
i];
185mat(
i, j) = values[
i][j];
189 if(values[
i].
size() ==
i+ 1) {
191mat(
i, j) = values[
i][j];
196mat(
i, j) = values[
i][j];
198mat(
i, j) = values[j][
i];
User-defined methods of the data storage class.
void FromMatrix(const CNcbiMatrix< double > &mat)
void Read(istream &istr, EFormat format=eGuess)
void AsMatrix(CNcbiMatrix< double > &mat) const
void Resize(size_t i, size_t j, T val=T())
resize this matrix, filling the empty cells with a known value
void Set(T val)
set all values in the matrix to a known value
size_t GetRows() const
get the number of rows in this matrix
size_t GetCols() const
get the number of columns in this matrix
static const struct name_t names[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
void ResetLabels(void)
Reset Labels data member.
void ResetDistances(void)
Reset Distances data member.
TDistances & SetDistances(void)
Assign a value to Distances data member.
const TDistances & GetDistances(void) const
Get the Distances member data.
const TLabels & GetLabels(void) const
Get the Labels member data.
TLabels & SetLabels(void)
Assign a value to Labels data member.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
const struct ncbi::grid::netcache::search::fields::SIZE size
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4