Skip to content

In tutorial, using x = foo or x(:,:) = foo? #75

@Beliavsky

Description

@Beliavsky

In the tutorial there are lines of code such as

  print *,A(i,1:m)
  mat(:,:) = 0.0

that could be written

  print *,A(i,:)
  mat = 0.0

I would either show the shorter syntax or show both versions and explain that they are equivalent. I would not want new Fortran programmers to get in the habit of using array sections when they can use refer to the whole array. I have read in the past about compilers that do not optimize x(:,:) as well as x. Maybe that has been fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    section: learnRelevant for the learn section on the webpage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions