ndarray
NumPy-friendly multidimensional arrays in C++
Loading...
Searching...
No Matches
ArrayAccess.h
Go to the documentation of this file.
1// -*- c++ -*-
2/*
3 * Copyright (c) 2010-2012, Jim Bosch
4 * All rights reserved.
5 *
6 * ndarray is distributed under a simple BSD-like license;
7 * see the LICENSE file that should be present in the root
8 * of the source distribution, or alternately available at:
9 * https://github.com/ndarray/ndarray
10 */
11#ifndef NDARRAY_DETAIL_ArrayAccess_h_INCLUDED
12#define NDARRAY_DETAIL_ArrayAccess_h_INCLUDED
13
21
22namespace ndarray {
23namespace detail {
24
25template <typename Array_>
27public:
28 typedef typename ExpressionTraits< Array_ >::Element Element;
29 typedef typename ExpressionTraits< Array_ >::Core Core;
30 typedef typename ExpressionTraits< Array_ >::CorePtr CorePtr;
31
32 static CorePtr const & getCore(Array_ const & array) {
33 return array._core;
34 }
35
36 static Array_ construct(Element * data, CorePtr const & core) {
37 return Array_(data, core);
38 }
39
40};
41
42} // namespace detail
43} // namespace ndarray
44
45#endif // !NDARRAY_DETAIL_ArrayAccess_h_INCLUDED
Traits for Expression.
Definition ArrayAccess.h:26
Traits for expressions.
Definition ExpressionTraits.h:30