Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.
 
 

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science

Array Visualizer Quick Start

Everything you need to know about ILNumerics Array Visualizer! Read in this section: 

Or read the in-depth manuals:

Getting Started - Installation

  • Go to the Microsoft Marketplace and download the ILNumerics extension to your machine. Double click on the VSIX. 
  • Alternatively, from the Visual Studio "Extensions" -> "Manage Extension" menu, search for 'ILNumerics' and install the extension from here. 

Debug Data Visualization - 3 Simple Steps

1. When halted in your Visual Studio debug session go to the Visual Studio View menu:     VIEW -> Other Windows -> ILNumerics Array Visualizer

2. Enter the name of an array variable from your current debug scope into the expression text area of the Array Visualizer

3. (Optional) Choose a plotting type from the list of available 2D and 3D plots

4. (Optional) Configure your current plot type further.

The Array Visualizer handles arbitrary expressions yielding one of the following array types:

  • .NET (C#, Visual Basic): ILNumerics arrays (Array<T>, InArray<T>, ...)
  • .NET (C#, F#, Visual Basic): all System.Array, pointer types if applicable
  • .NET struct arrays, arrays of custom records / structs
  • C/C++: 1D arrays (double a[500], etc.)
  • C/C++: nested 1D arrays (multidimensional arrays, int b[50][40], ...)
  • C/C++: pointers of any numeric type (int*, float[5]*)
  • C/C++: instances of std::vector<T>, std::array<T,n>, std::valarray<T>
  • FORTRAN (ifort): all applicable array types, including ND arrays, ALLOCATABLE arrays and arrays of structs.
  • All common numeric element types are supported in any language.

The expression entered in the Array Visualizer will be evaluated as follows:

  • The context of the current debug stack frame is used. Hence, your program must be halted in debug mode.
  • The Array Visualizer will use the same debug engine as used for the debugee. Any code which is valid in the current language can be used as expression for the Array Visualizer.You may use variables from the current scope. Or enter arbitrary valid custom expressions!
  • Expressions are of arbitrary complexity. They may include subarray expressions, properties (like .T to transpose an ILNumerics array), and calls to any function reachable from within your debug scope.

Examples:

In order to visualize the content of an array variable A just type 'A' and hit [Enter].

Ad-hoc visualizations of any vector data are possible by entering code which creates an array containing the desired elements. For C# one could write: new[] {1.2, 5, -2.223, 1, 1.02 } in order to create, let's say, a line plot based on these 5 values:

If you are lucky to work with ILNumerics Computing Engine you may use any function from any ILNumerics module currently referenced by your project, including ILMath, ILNumerics.numpy, any toolbox, accessing HDF5 data, and so forth...

Read the manual specific to your language to learn everything about debug data plotting: C#, F#, Visual Basic, C/C++, FORTRAN.

Entering Expressions

There are two main modes for the Array Visualizer:

  • Use text expressions as simple language elements (array variables, function calls yielding arrays, etc.)
  • Prefix your text expressions with array descriptors to determine additional properties.

By default, one simply enters an array expression and receives the current result. All array properties required for plotting are automatically derived from the target array object. 

In case not all array properties can be automatically determined from the array object or if the user decides to take more control of the target array, the Array Visualizer can be set into array descriptor mode. Here, an array descriptor expression is prepended to the array expression. The array descriptor expression enables you to take full control over how your array elements are read from memory: element type, dimension sizes, strides, and memory address offset. Read all about array descriptors.

Reseting Array Descriptor Data

In array descriptor mode, the instructions how to interprete array elements from memory is taken from the array descriptor. The actual array properties (if stored with the array) are ignored. This allows to reinterpret array instances in arbitrary ways. In order to clear the array descriptor and start all over with the actual array properties, simply clear the whole expression window and start typing from scratch. Alternatively, hold down the CTRL key together with the ENTER key when committing an expression for evaluation. This will clear any predefined array descriptor but keep the array expression untouched. Alternatively, you may reset individual parts of the array descriptor. Read more

Making Use of Expression Logs

Expressions entered into the Array Visualizer are stored for later retrieval. This is well known from other places in Visual Studio and helps to come back to an earlier expression easily and quickly. The history will be shown directly below the expression text box when the user begins to enter an expression. The list of expressions is filtered by the start of the current expression text box content.

In order to manually access the list of historic expressions, press the DOWN cursor key when the focus is in the expression textbox.

Navigating the history list

  • Cursor keys up / down: select the next / previous list item.
  • Curson key right / Enter / Tab: accept the currently highlighted item for re-evaluation.
  • ESC key: hide the history list without changing the current expression.

Exporting Debug Data

The Array Visualizer lets you export the data currently shown to a large number of data formats and images. The Share menu on the top right of the Array Visualizer tool window provides access to all functions. Export your data as PNG, SVG, bitmap, CSV, HDF5 or Matlab files! Or simply copy and paste the data into Microsoft Excel tables, Microsoft Word as exact numbers or image objects.

Read more ...

Error Handling 

Errors happen. If you entered an expression which cannot be evaluated, if there is user input missing, if anything else goes wrong - the Array Visualizer will let you know. The error is shown directly beneath the expression text as an info bubble:

The bubble is shown for a couple of seconds. In order to inspect the error more closely, visit the Output window. All errors are also logged in the General tab.

Compatibility

The Array Visualizer is available for all recent Visual Studio® versions, including 2017 and 2022, including Visual Studio Community Edition. It supports C#, F#, Visual Basic, C/C++, and FORTRAN (ifort) on 32 and 64 bit projects. 

Further Reading