<commit_before>/*!
 * The file defines class for wrapping ND volumes.
 *
 * \author <NAME> (<EMAIL>)
*/

#ifndef DVIDVOXELS_H
#define DVIDVOXELS_H

#include "BinaryData.h"
#include "DVIDException.h"
#include "Globals.h"

#include <string>
#include <vector>

namespace libdvid {

//! Represents dimension sizes for ND volumes
//! TODO: create a special class for dims and offset
typedef std::vector<unsigned int> Dims_t;

/*!
 * Wrapper for binary data that is part of an n-D array.  This
 * just associates a shape with a binary blob.  For a 3D volume,
 * dim1, dim2, dim3 means that dim1 represents the number of matrix
 * columns.  Typically, dim1, dim2, and dim3 corresponds to x,y,z.
 * This templated class requires the number of dimensions
 * to be specified.
*/
template <typename T, unsigned int N>
class DVIDVoxels {
  public:
    /*!
     * Construtor takes a constant buffer, creates a binary
     * buffer of a certain length and associates it with
     * a volume of the provided dimensions.
     * \param array_ buffer to be copied
     * \param length number of bytes in buffer
     * \param dims_ dimension sizes for the volume
    */ 
    DVIDVoxels(const T* array_, unsigned int length, Dims_t& dims_)
               : dims(dims_) {
        uint64 total_size = uint64(dims_[0])*uint64(dims_[1])*
            uint64(dims_[2])*uint64(sizeof(T)); <commit_msg>DVIDVoxels: Declare template parameters as members.<commit_after>/*!
 * The file defines class for wrapping ND volumes.
 *
 * \author <NAME> (<EMAIL>)
*/

#ifndef DVIDVOXELS_H
#define DVIDVOXELS_H

#include "BinaryData.h"
#include "DVIDException.h"
#include "Globals.h"

#include <string>
#include <vector>

namespace libdvid {

//! Represents dimension sizes for ND volumes
//! TODO: create a special class for dims and offset
typedef std::vector<unsigned int> Dims_t;

/*!
 * Wrapper for binary data that is part of an n-D array.  This
 * just associates a shape with a binary blob.  For a 3D volume,
 * dim1, dim2, dim3 means that dim1 represents the number of matrix
 * columns.  Typically, dim1, dim2, and dim3 corresponds to x,y,z.
 * This templated class requires the number of dimensions
 * to be specified.
*/
template <typename T, unsigned int N>
class DVIDVoxels {
  public:

    typedef T voxel_type;
    const static int num_dims = N;

    /*!
     * Construtor takes a constant buffer, creates a binary
     * buffer of a certain length and associates it with
     * a volume of the provided dimensions.
     * \param array_ buffer to be copied
     * \param length number of bytes in buffer
     * \param dims_ dimension sizes for the volume
    */ 
    DVIDVoxels(const T* array_, unsigned int length, Dims_t& dims_)
               : dims(dims_) {
        uint64 total_size = uint64(dims_[0])*uint64(dims_[1])*
            uint64(dims_[2])*uint64(sizeof(T)); 
{'fraction_non_alphanumeric': 0.09231309231309232, 'fraction_numerical': 0.014742014742014743, 'mean_word_length': 3.3181818181818183, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1264240', 'n_tokens_mistral': 916, 'n_tokens_neox': 886, 'n_words': 347}