RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: Persistence Methods Up: Searching Methods Previous: SearchGreaterThanEqual

SearchBetween

NAME SearchBetween

PROTOTYPE

#include "ISTable.h"

ReVarPCifArray<int> * ISTable::SearchBetween(
                                  ReVarCifArray<CifString> &targets1, 
                                  ReVarCifArray<CifString> &targets2, 
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::SearchBetween(
                                  ReVarCifArray<CifString> &targets1, 
                                  ReVarCifArray<CifString> &targets2,  
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::SearchBetween(
                                  CifString indexName, 
                                  ReVarCifArray<CifString> &targets1, 
                                  ReVarCifArray<CifString> &targets2,  
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);

ReVarPCifArray<int> * ISTable::SearchBetween(
                                  CifString indexName, 
                                  ReVarCifArray<CifString> &targets1,  
                                  ReVarCifArray<CifString> &targets2, 
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);

EXAMPLE

#include "ISTable.h"

CifString cs1("30.00"), cs2("50.00"), col1("twist");
int errCode = 0;
ISTable s("MyTable");
...
s.SetFlags(ISTable::DT_DOUBLE, s.GetColumnIndex(col1.Text()));
s.SetPrecision(2, s.GetColumnIndex(col1.Text()));

ReVarCifArray<CifString> vals1, vals2, names;
vals1.Add(cs1);
vals2.Add(cs2);
names.Add(col1); 
s->CreateIndex("index0",names);

ReVarPCifArray<int> * iArray;
iArray = s.SearchBetween(vals1, vals2, names, errCode);
if (iArray) {
  for (int i = 0; i < iArray->Length(); i++) {
    // do something to each row with twist >= 30.00 and twist <= 50.00
  }
}
PURPOSE

SearchBetween returns the row indices of cells in a column that are greater than or equal the target1 and less then or equal the target2 value.

RECEIVES

SearchBetween(ReVarCifArray<CifString>&, ReVarCifArray<CifString>&, int &)

targets1 An array of target strings to search for.
targets2 An array of target strings to search for.
colNames The names of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

SearchBetween(ReVarCifArray<CifString>&, ReVarCifArray<int>&, int &)

targets1 An array of target strings to search for.
targets2 An array of target strings to search for.
colIds The indices of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

SearchBetween(CifString, ReVarCifArray<CifString>&,
ReVarCifArray<CifString>&, int &)

indexName Name of the index used for searching.
targets1 An array of target strings to search for.
targets2 An array of target strings to search for.
colNames The names of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

SearchBetween(CifString, ReVarCifArray<CifString>&,
ReVarCifArray<int>&, int &)

indexName Name of the index used for searching.
targets1 An array of target strings to search for.
targets2 An array of target strings to search for.
colIds The indices of the columns to search.
errCode A reference to an integer holding the error code resulting from this operation.

RETURN VALUE

A pointer to a ReVarPCifArray<int> holding the row indices of the cells containing a value less than the target.
A NULL value indicates a possible error or an unsuccessful search.
A negative value in errCode indicates an error or warning.

REMARKS

See also: SearchLessThan
  SearchLessThanEqual
  SearchGreaterThan
  SearchGreaterThanEqual


next up previous contents
Next: Persistence Methods Up: Searching Methods Previous: SearchGreaterThanEqual
Olivera Tosic
6/12/2002

 

© RCSB PDB