title: Where are cv::Mat constructors explicitly defined?
body: <p>[1] Where are the cv::Mat data structure constructors explicitly (in C/C++) defined in the OpenCV source code?</p>
  
  <p>I assume a cv::Mat data structure is dynamically allocated to the heap when something like </p>
  
  <p><code>cv::Mat mat(rows, cols, type);</code> </p>
  
  <p>is called, but could neither find the ANSI C or C++ implementation in</p>
  
  <p><code>opencv / modules / core / src / matrix.cpp</code> nor in</p>
  
  <p><code>opencv / modules / core / src / datastructs.cpp</code>.</p>
  
  <p><strong>SOLVED:</strong> <code>cv::Mat</code> is allocated with a <code>fastMalloc()</code> in <a href="https://github.com/Itseez/opencv/blob/master/modules/core/src/matrix.cpp#L183" rel="nofollow">matrix.cpp</a>.  this is performed within the <code>cv::Mat:create()</code> <a href="http://opencv.willowgarage.com/documentation/cpp/basic_structures.html#cv-mat-create" rel="nofollow">function</a>.</p>
  
  <p>[2] Further, I'm curious to know where in hardware the cv::Mat will be located when image processing operations are performed:</p>
  
  <p>. always in 'main memory' (SDRAM),</p>
  
  <p>. always in on-chip caches (SRAM),</p>
  
  <p>. or some combination of the two? </p>