// Col returns a vector representing the corresponding column (starting at col 0).
// This package makes no distinction between row and column vectors, so it
// will be a normal VecN for a MxN matrix.
337670
func (m Mat3x2) Col(col int) Vec3 {
	return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]}
}
192672
func (m Mat2) Row(row int) Vec2 {
	return Vec2{m[row+0], m[row+2]}
}
749497
func (r *Rows) column(slice interface{}) error {
	defer r.Close()

	v := reflect.ValueOf(slice)
	if v.Kind() != reflect.Ptr || v.IsNil() {
		return VarTypeError("must be a pointer to a slice")
	}
	v = indirect(v)

	if v.Kind() != reflect.Slice {
		return VarTypeError("must be a pointer to a slice")
	}

	et := v.Type().Elem()

	cols, _ := r.Columns()
	for r.Next() {
		ev := reflect.New(et)
		refs := make([]interface{}, len(cols))
		for i := range cols {
			if i == 0 {
				refs[i] = ev.Interface()
			} else {
				refs[i] = &sql.NullString{}
			}
		}
		if err := r.Scan(refs...); err != nil {
			return err
		}
		v.Set(reflect.Append(v, ev.Elem()))
	}

	return r.Close()
}
1342216
func (mat *T) Get(col, row int) float32 {
	return mat[col][row]
}
1232928
func (index *Index) AddColumn(cols ...string) {
	for _, col := range cols {
		index.Cols = append(index.Cols, col)
	}
}
1279061
func (m Mat3) Col(col int) Vec3 {
	return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]}
}
1080724
func (r *boltRows) Columns() []string {
	fieldsInt, ok := r.metadata["fields"]
	if !ok {
		return []string{}
	}

	fields, ok := fieldsInt.([]interface{})
	if !ok {
		log.Errorf("Unrecognized fields from success message: %#v", fieldsInt)
		return []string{}
	}

	fieldsStr := make([]string, len(fields))
	for i, f := range fields {
		if fieldsStr[i], ok = f.(string); !ok {
			log.Errorf("Unrecognized fields from success message: %#v", fieldsInt)
			return []string{}
		}
	}
	return fieldsStr
}
497918
func (m Mat3x2) Cols() (col0, col1 Vec3) {
	return m.Col(0), m.Col(1)
}
422384
func (s *Sheet) Col(idx int) *Col {
	s.maybeAddCol(idx + 1)
	return s.Cols[idx]
}
820120
func (rows *Rows) Columns() ([]string, error) {
	if rows.token == nil {
		return []string{}, nil
	}
	startElement := rows.token.(xml.StartElement)
	r := xlsxRow{}
	_ = rows.decoder.DecodeElement(&r, &startElement)
	d := rows.f.sharedStringsReader()
	columns := make([]string, len(r.C))
	for _, colCell := range r.C {
		col, _, err := CellNameToCoordinates(colCell.R)
		if err != nil {
			return columns, err
		}
		val, _ := colCell.getValueFrom(rows.f, d)
		columns[col-1] = val
	}
	return columns, nil
}
838860
func (node Columns) FindColumn(col ColIdent) int {
	for i, colName := range node {
		if colName.Equal(col) {
			return i
		}
	}
	return -1
}
1173165
func (statement *Statement) Cols(columns ...string) *Statement {
	cols := col2NewCols(columns...)
	for _, nc := range cols {
		statement.columnMap.add(nc)
	}

	newColumns := statement.colmap2NewColsWithQuote()

	statement.ColumnStr = strings.Join(newColumns, ", ")
	statement.ColumnStr = strings.Replace(statement.ColumnStr, statement.Engine.quote("*"), "*", -1)
	return statement
}
94978
func (m *machine) Column() int {
	lineOffset := m.p - m.sol
	return lineOffset + 1
}
305578
func (m *Matrix) Size() (rows, cols int) {
	rows = len(m.elements) / m.stride
	cols = m.stride
	return
}
783328
func (m *Mat4) SetCol(col int, v Vec4) {
	m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3]
}
362638
func (d *Dataset) Column(header string) []interface{} {
	colIndex := indexOfColumn(header, d)
	if colIndex == -1 {
		return nil
	}

	values := make([]interface{}, d.rows)
	for i, e := range d.data {
		switch e[colIndex].(type) {
		case DynamicColumn:
			values[i] = e[colIndex].(DynamicColumn)(e)
		default:
			values[i] = e[colIndex]
		}
	}
	return values
}
83479
func matrixSubVector(mat, vec *mat.Dense) *mat.Dense {
	rowsm, colsm := mat.Dims()
	_, colsv := vec.Dims()
	if colsv != colsm {
		panic("Error in dimension")
	}
	for i := 0; i < rowsm; i++ {
		for j := 0; j < colsm; j++ {
			mat.Set(i, j, (mat.At(i, j) - vec.At(0, j)))
		}
	}
	return mat
}