本文整理汇总了C++中Column函数的典型用法代码示例。如果您正苦于以下问题:C++ Column函数的具体用法?C++ Column怎么用?C++ Column使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Column函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: left
DataFrameJoinVisitors::DataFrameJoinVisitors(const DataFrame& left_, const DataFrame& right_, const SymbolVector& names_left, const SymbolVector& names_right, bool warn_, bool na_match) :
left(left_), right(right_),
visitor_names_left(names_left),
visitor_names_right(names_right),
visitors(names_left.size()),
warn(warn_)
{
IntegerVector indices_left = names_left.match_in_table(RCPP_GET_NAMES(left));
IntegerVector indices_right = names_right.match_in_table(RCPP_GET_NAMES(right));
const int nvisitors = indices_left.size();
if (indices_right.size() != nvisitors) {
stop("Different size of join column index vectors");
}
for (int i = 0; i < nvisitors; i++) {
const SymbolString& name_left = names_left[i];
const SymbolString& name_right = names_right[i];
if (indices_left[i] == NA_INTEGER) {
stop("'%s' column not found in lhs, cannot join", name_left.get_utf8_cstring());
}
if (indices_right[i] == NA_INTEGER) {
stop("'%s' column not found in rhs, cannot join", name_right.get_utf8_cstring());
}
visitors[i] =
join_visitor(
Column(left[indices_left[i] - 1], name_left),
Column(right[indices_right[i] - 1], name_right),
warn, na_match
);
}
}
示例2: Close
void VfkStream::Open(const VectorMap<int, String>& fns)
{
Close();
charset = CHARSET_ISO8859_2;
file_groups <<= fns;
streams.SetCount(file_groups.GetCount());
for(int i = 0; i < streams.GetCount(); i++)
if(!streams[i].Open(file_groups[i]))
throw Exc(NFormat("cannot open file '%s'", file_groups[i]));
indexfilename = GetTempFileName("vfk");
if(!indexfile.Open(indexfilename, FileStream::CREATE))
throw Exc(NFormat("cannot create indexfile '%s'", indexfilename));
String hdrname = "X_HEADER";
Table& hdr = tables.Add(hdrname);
hdr.name = hdr.rawname = hdrname;
hdr.header = true;
hdr.row_count = 0;
ASSERT(hdr.columns.GetCount() == HDR_ID);
hdr.AddColumn(Column("ID", STRING_V, 30));
ASSERT(hdr.columns.GetCount() == HDR_ORD);
hdr.AddColumn(Column("ORD", INT_V));
ASSERT(hdr.columns.GetCount() == HDR_STR);
hdr.AddColumn(Column("STR", STRING_V, 1000));
ASSERT(hdr.columns.GetCount() == HDR_NUM);
hdr.AddColumn(Column("NUM", DOUBLE_V));
ASSERT(hdr.columns.GetCount() == HDR_DTM);
hdr.AddColumn(Column("DTM", TIME_V));
ASSERT(hdr.columns.GetCount() == HDR_COUNT);
Scan();
}
示例3: m
Matrix Matrix::Cofactor() const {
Matrix m(Row(), Column());
for (int i = 0; i < Row(); i++) {
for (int j = 0; j < Column(); j++) {
m(i, j) = Cofactor(i, j);
}
}
return m;
}
示例4: WidgetQmfObject
WidgetBindings::WidgetBindings(QWidget *parent) :
WidgetQmfObject(parent)
{
this->setSectionName(QString("Bindings"));
summaryColumns.append(Column("msgMatched", "matched", Qt::AlignRight, "N", modeMessages, true));
summaryColumns.append(Column("msgMatched", "matched / sec", Qt::AlignRight, "N", modeMessageRate, true));
setRelatedText("Related bindings");
}
示例5: calcSrcCols
static ColumnList calcSrcCols(int tilesetH)
{
ColumnList cols;
cols << Column(0, 0, tilesetH);
cols << Column(tsLaneW, 0, tilesetH);
return cols;
}
示例6: calcSrcCols
static ColumnVec calcSrcCols(int tilesetH)
{
ColumnVec cols;
cols.reserve(2);
cols.push_back(Column(0, 0, tilesetH));
cols.push_back(Column(tsLaneW, 0, tilesetH));
return cols;
}
示例7: Column
void
RotationMatrix2<T>::Fixup( )
{
Vector2<T> v0 = Column( 0 );
Vector2<T> v1 = Column( 1 );
v0.Normalize( );
v1 -= (v0 * v1) * v0;
v1.Normalize( );
m_matrix.Set( v0, v1 );
}
示例8: Column
void
RotationMatrix3<T>::Fixup( )
{
Vector3<T> v0 = Column( 0 );
Vector3<T> v1 = Column( 1 );
Vector3<T> v2 = Column( 2 );
v0.Normalize( );
v1 -= (v0 * v1) * v0;
v1.Normalize( );
v2 -= (v0 * v2) * v0 + (v1 * v2) * v2;
v2.Normalize( );
m_matrix.Set( v0, v1, v2 );
}
示例9: tabs
bool NdbInfo::load_hardcoded_tables(void)
{
{
Table tabs("tables", 0);
if (!tabs.addColumn(Column("table_id", 0, Column::Number)) ||
!tabs.addColumn(Column("table_name", 1, Column::String)) ||
!tabs.addColumn(Column("comment", 2, Column::String)))
return false;
BaseString hash_key = mysql_table_name(tabs.getName());
if (!m_tables.insert(hash_key.c_str(), tabs))
return false;
if (!m_tables.search(hash_key.c_str(), &m_tables_table))
return false;
}
{
Table cols("columns", 1);
if (!cols.addColumn(Column("table_id", 0, Column::Number)) ||
!cols.addColumn(Column("column_id", 1, Column::Number)) ||
!cols.addColumn(Column("column_name", 2, Column::String)) ||
!cols.addColumn(Column("column_type", 3, Column::Number)) ||
!cols.addColumn(Column("comment", 4, Column::String)))
return false;
BaseString hash_key = mysql_table_name(cols.getName());
if (!m_tables.insert(hash_key.c_str(), cols))
return false;
if (!m_tables.search(hash_key.c_str(), &m_columns_table))
return false;
}
return true;
}
示例10: Message
Message ParserMixin::severityMessage(const ParseContextSPtr& context,
const Message::Severity& severity,
const char* message,
const Line& line,
const Column& column)
{
TokenizerPtr& tokenizer = context->tokenizer;
Line theLine = line;
if (theLine == Line(-1))
{
theLine = tokenizer->current()
? tokenizer->current()->line()
: tokenizer->line();
}
Column theColumn = column;
if (theColumn == Column(-1))
{
theColumn = tokenizer->current()
? tokenizer->current()->beginColumn()
: tokenizer->column();
}
return Message(severity, message, context->mSourceId, theLine, theColumn);
}
示例11: Column
TDbCell* RDbRow::Column(TInt aColIx) const
//
// aCol is now zero-based
// Return a pointer to column aCol in the buffer
// Return 0 if the column is past the end
//
{
TInt ix=Column();
TDbCell* pC;
if (aColIx<ix)
{
ix=0;
pC=iFirst;
}
else
pC=iCell;
TDbCell* last=iLast;
for (;;)
{
if (pC>=last)
break;
if (ix>=aColIx)
break;
pC=pC->Next();
++ix;
}
CONST_CAST(RDbRow*,this)->SetCache(pC,ix);
return pC<last?pC:0;
}
示例12: meshgrid
/**
* @brief MATLAB-like meshgrid. x and y vectors must be specified z may be specified optionally.
*
* @param x X-Vector
* @param y Y-Vector
* @param z Z-Vector (default: unused)
* @return Mesh grid O (Ny x Nx x Nz x 3) (if z specified) else O (Ny x Nx x 2)<br/>
*/
template <class T> inline static Matrix<T>
meshgrid (const Vector<T>& x, const Vector<T>& y, const Vector<T>& z = Vector<T>(1)) {
size_t nx = numel(x);
size_t ny = numel(y);
size_t nz = numel(z);
assert (nx > 1);
assert (ny > 1);
// Column vectors
assert (size(x,0) == nx);
assert (size(y,0) == ny);
assert (size(z,0) == nz);
Matrix<T> res (ny, nx, (nz > 1) ? nz : 2, (nz > 1) ? 3 : 1);
for (size_t i = 0; i < ny * nz; i++)
Row (res, i , x);
for (size_t i = 0; i < nx * nz; i++)
Column (res, i + nx * nz, y);
if (nz > 1)
for (size_t i = 0; i < nz; i++)
Slice (res, i + 2 * nz, z[i]);
return res;
}
示例13: Column
void Parser::atom() {
if (tokens[look].type == REGEX_) {
atoms.push_back(Atom(REG, 0, 0, tokens[look].value, Column()));
match(REGEX_);
} else {
match(LESSTHAN);
if (tokens[look].type == TOKEN) {
match(TOKEN);
} else {
column();
cols[col[1]] = col[0];
atoms.push_back(Atom(COLUMN, 0, 0, col[1], Column()));
}
match(GREATETHAN);
}
}
示例14: VDASSERT
void VDUIListViewW32::AddColumn(const wchar_t *name, int width, int affinity) {
VDASSERT(affinity >= 0);
VDASSERT(width >= 0);
if (VDIsWindowsNT()) {
LVCOLUMNW lvcw={0};
lvcw.mask = LVCF_TEXT | LVCF_WIDTH;
lvcw.pszText = (LPWSTR)name;
lvcw.cx = width;
SendMessageW(mhwnd, LVM_INSERTCOLUMNW, mColumns.size(), (LPARAM)&lvcw);
} else {
LVCOLUMNA lvca={0};
VDStringA nameA(VDTextWToA(name));
lvca.mask = LVCF_TEXT | LVCF_WIDTH;
lvca.pszText = (LPSTR)nameA.c_str();
lvca.cx = width;
SendMessageA(mhwnd, LVM_INSERTCOLUMNA, mColumns.size(), (LPARAM)&lvca);
}
mColumns.push_back(Column());
Column& col = mColumns.back();
col.mWidth = width;
col.mAffinity = affinity;
mTotalWidth += width;
mTotalAffinity += affinity;
OnResize();
}
示例15: __ASSERT
EXPORT_C TAny* RDbRow::SetColumnWidthL(TDbColNo aColNo,TInt aWidth)
// set the width for column aCol to Width
// add extra NULL columns to buffer as required
// return pointer to data for that column
{
__ASSERT(aColNo>0);
TDbCell* pC=Column(--aColNo);
if (pC==0)
{ // add extra NULL columns to buffer
if (aWidth==0)
return 0; // setting to NULL, don't bother padding
TInt cFill=(aColNo-iColumn)*sizeof(TInt);
ExtendL(cFill+TDbCell::Size(aWidth));
pC=iCell;
Mem::FillZ(pC,cFill);
pC=PtrAdd(pC,cFill); // set cache
SetCache(pC,aColNo);
}
else
{
TInt adjust=TDbCell::Size(aWidth)-pC->Size(); // how much to add
if (adjust!=0)
{
ExtendL(adjust);
pC=iCell; // may have moved in extension
TDbCell* pNext=pC->Next();
TDbCell* pAdjust=PtrAdd(pNext,adjust);
Mem::Move(pAdjust,pNext,Diff(pAdjust,iLast));
}
}
pC->SetLength(aWidth);
return pC->Data();
}