nwtomatafast

Return a link to the adjacency matrix of a network

Syntax

nwtomatafast
[netname]

Description

Internally, networks are saved as adjacency matrices in Mata. This command returns the name of the Mata matrix where a network is stored in the return vector. It differs from nwtomata in the following way. It only returns a link to the adjacency matrix and does not produce a copy of the adjacency matrix.

  • This can be useful, when you want to directly interact with the underlying adjacency matrix. But I only recommend this for advanced programmers.
  • Caution is advised because the relevant meta-information is not updated when changing the adjacency matrix of a network.

Supported network types

Binary: yes. Directed: yes. Weighted: yes. Signed: yes. Two-mode: yes - returns a live pointer to the network’s own internal matrix (not a copy), independent of any of these properties; changes made through it directly alter the network.

See also


nwcommands version 3.17.6, 9 November 2026 (check your installed version)


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.