Close
Close window
Contents - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Maple Programming Guide

Contents

4.1 In This Chapter

4.2 Introduction

4.3 Immutable Data Structures

Lists

Creating Lists

Accessing Data Stored in a List

Determining If an Element Is in a List

Getting the Number of Elements in a List

Sorting a List

Applying a Function to the Contents of a List

Sets

Creating Sets

Set Arithmetic

Accessing Data Stored in a Set

Determining If an Element Is in a Set

Getting the Number of Elements in a Set

Applying a Function to the Contents of a Set

4.4 Mutable Data Structures

Tables

Creating Tables

Accessing Stored Values

Removing an Element

Getting the Number of Elements Stored in a Table

Checking If an Index Is Used

Evaluation Rules for Tables

Extracting Data

Copying Tables

Applying a Function to the Contents of a Table

Arrays

Creating Arrays

Basic Data Access

Sub-Array Access

Automatic Resizing

More Array Indexing

Getting the Number of Elements in an Array

Getting the Bounds of an Array

Copying an Array

Testing If Two Arrays Are Equal

Applying a Function to the Contents of an Array

Better Performance with Numeric Arrays

Deprecated: array

4.5 Other Data Structure Operations

Filtering Data Structure Elements

Converting Data Structures

4.6 Other Data Structures

Records

Create a Record

Record Equality

Packed Records

Stacks

Creating a Stack

Pushing and Popping

More Stack Functions

Queues

Create a Queue

Enqueue and Dequeue

More Queue Functions

4.7 Data Coercion

4.8 Data Structure Performance Comparisons

Indexing

Membership

Building a Collection of Data

4.9 Avoiding Common Problems

Passing Sequences into Functions

Incorrect Index Values

Array Indices Do Not Always Start at 1

Do Not Treat Lists and Sets as Mutable

4.10 Exercises

6.1 Terminology

6.2 Defining and Executing Procedures

6.3 Parameter Declarations

Required Positional Parameters

Optional Ordered Parameters

Expected Ordered Parameters

Keyword Parameters

The End-of-Parameters Marker

Default Value Dependencies

Parameter Modifiers

The seq Modifier

The depends Modifier

The uneval Modifier

The evaln Modifier

The coercion Modifiers

Procedures without Declared Parameters

6.4 Return Type

6.5 The Procedure Body

Description

Options

The arrow and operator Options

The builtin Option

The call_external Option

The hfloat Option

The inline Option

The overload Option

The procname Option

The remember, cache, and system Options

The trace Option

Variables in Procedures

Global Variables

Local Variables

Lexically Scoped Variables

Scoping Rules

Non-Variable Name Bindings

The Statement Sequence

Referring to Parameters within the Procedure Body

Parameters Are Not Variables

Required Parameters

Parameters with the seq Modifier

Parameters with the uneval or evaln Modifiers

Optional and Expected Ordered Parameters

Keyword Parameters

Special Sequences for Referring to Parameters and Arguments

6.6 How Procedures Are Executed

Binding of Arguments to Parameters

Binding of Keyword Arguments

The Special Case of evaln and uneval Modifiers

Binding of Arguments to Positional and Ordered Parameters

Statement Sequence Interpretation

Variable Evaluation Rules within Procedures

Returning Values from a Procedure

Returning Unevaluated

6.7 Using Data Structures with Procedures

Passing Data Structures to Procedures

Returning Data Structures from Procedures

Example: Computing an Average

Example: Binary Search

Example: Plotting the Roots of a Polynomial

6.8 Writing Usable and Maintainable Procedures

Formatting Procedures for Readability

Commenting Your Code

6.9 Other Methods for Creating Procedures

Functional Operators: Mapping Notation

The unapply Function

Anonymous Procedures

6.10 Recursion

6.11 Procedures That Return Procedures

Example: Creating a Newton Iteration

Example: A Shift Operator

6.12 The Procedure Object

The procedure Type

Procedure Operands

6.13 Exercises

14.1 In This Chapter

Connecting to the Maple Engine

Using External Libraries in Maple

Connecting Maple to Another Program

Code Generation

14.2 MapleNet

Computation on Demand

14.3 OpenMaple

Runtime Environment Prerequisites

Interface Overview

Text Callbacks

Initializing the Maple Engine

Calling API Commands to Compute with Maple

C/C++ Example

C# Example

Java Example

Visual Basic 6 Example

Visual Basic .NET Example

Memory Usage

14.4 The Maple Command-line Interface

Batch Files

Directing Input to a Pipeline

Specifying Start-up Commands

14.5 External Calling: Using Compiled Code in Maple

Calling a Function in a Dynamic-link Library

Create or Obtain a .dll file

Create a Function Specification

Calling the External Function

Specifying Parameter Types for Function Specifications

Scalar Data Formats

Structured Data Formats

External Function Interface

Specifying Parameter Passing Conventions

Generating Wrappers Automatically

Passing Arguments by Reference

External API

System Integrity

14.6 Accessing Data over a Network with TCP/IP Sockets

Socket Server

Socket Client

14.7 Code Generation

Calling CodeGeneration Commands

Notes on Code Translation

Translation Process

Example 1: Translating a Procedure to Java

Example 2: Translating a Procedure to C

Example 3: Translating a Procedure to Fortran

Example 4: Translating an Expression to MATLAB®

Example 5: Translating an Expression to Perl

Example 6: Translating an Expression to Python

Example 7: Translating Commands to R

Example 8: Translating a Procedure to Visual Basic

Example 9: Using the defaulttype and deducetypes Options

Example 10: Using the declare Option

The Intermediate Code

Extending the CodeGeneration Translation Facilities

The Printing Phase

Defining a Custom Translator

Using a Printer Module

Language Translator Definition

Using the Define Command

Creating a Language Definition Module

Using a New Translator

14.8 CAD Connectivity

14.9 Maple Plug-in for Excel

14.10 Connecting MATLAB® and Maple

Accessing the MATLAB® Computation Engine from Maple

Accessing the Maple Computational Engine from MATLAB®

Internal Functions

Evaluators

Algebraic Functions

Algebraic Service Functions

Data Structure Manipulation Functions

General Service Functions

Flow of Control

Internal Representations of Data Types

AND: Logical AND

ASSIGN: Assignment Statement or Expression

BINARY: Binary Object

BREAK: Break Statement

CATENATE: Name Concatenation

COMPLEX: Complex Value

CONTROL: Communications Control Structure

DCOLON: Type Specification or Test

DEBUG: Debug

EQUATION: Equation or Test for Equality

ERROR: Error Statement

EXPSEQ: Expression Sequence

FLOAT: Software Floating-Point Number

FOR: For/While Loop Statement

FOREIGN: Foreign Data

FUNCTION: Function Call

GARBAGE: Garbage

HFLOAT: Hardware Float

IF: If Statement

IMPLIES: Logical IMPLIES

INEQUAT: Not Equal or Test for Inequality

INTNEG: Negative Integer

INTPOS: Positive Integer

LESSEQ: Less Than or Equal

LESSTHAN: Less Than

LEXICAL: Lexically Scoped Variable within an Expression

LIST: List

LOCAL: Local Variable within an Expression

MEMBER: Module Member

MODDEF: Module Definition

MODULE: Module Instance

NAME: Identifier

NEXT: Next Statement

NOT: Logical NOT

OR: Logical OR

PARAM: Procedure Parameter in an Expression

POLY: Multivariate Polynomials with Integer Coefficients

POWER: Power

PROC: Procedure Definition

PROD: Product, Quotient, Power

RANGE: Range

RATIONAL: Rational

READ: Read Statement

RETURN: Return Statement

RTABLE: Rectangular Table

SAVE: Save Statement

SDPOLY: Sparse Distributed Multivariate Polynomial

SERIES: Series

SET: Set

STATSEQ: Statement Sequence

STOP: Quit Statement

STRING: Character String

SUM: Sum, Difference

TABLE: Table

TABLEREF: Table Reference

TRY: Try Statement

UNEVAL: Unevaluated Expression

USE: Use Statement

XOR: Logical Exclusive-Or

ZPPOLY: Polynomials with Integer Coefficients modulo n

Hashing in Maple

Basic Hash Tables

Hash Table

Hash Chain

Dynamic Hash Tables

Cache Hash Tables

The Simplification Table

The Name Table

Remember Tables

Maple Language Arrays and Tables

Maple Language Rectangular Tables

Portability

List of Figures

List of Tables


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /